-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: make target to run black-formatter as it is used in PR checks. #174
Conversation
Comment as on IRC: This should probably also add a Potentially we could then drop black and flake8 as separate GitHub actions because the main testing would run them, but then we'd lose inline notes from TrueBrain's action. |
445a2b2
to
7606e08
Compare
I added them to "make test". |
I don't think that's an issue really; Perhaps the people building distro packages will mind? In principle we could have a test script that checks whether they're installed and warns but succeeds otherwise, but that seems TMWFTLB. |
7606e08
to
50dba20
Compare
I guess this should add |
4dc091a
to
a33fc33
Compare
Not sure I like this being rolled into the |
a33fc33
to
5072d29
Compare
@@ -1,11 +1,13 @@ | |||
MAKE?=make | |||
PYTHON?=/usr/bin/env python3 | |||
BLACK_OPTIONS=-l 120 --exclude 'action2var_variables.py|action3_callbacks.py|generated' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you like, black options can also be put in pyproject.toml
, see https://black.readthedocs.io/en/stable/pyproject_toml.html .
This makes sure that if someone executed black
, it picks up the right rules too.
I have yet to apply this for all other OpenTTD projects :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think such quality of life improvements are always a good thing. You cannot execute tests often enough.
@@ -15,3 +17,10 @@ extensions: | |||
|
|||
clean: | |||
$(MAKE) -C regression clean | |||
|
|||
flake: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My OCD cannot handle that make flake
also executes black .. but using any other name is silly :P
As much as a regression shows a runtime error, |
Conclusion: noone likes pyproject.toml |
I don't know how you invoke black. But there are quite some custom options for NML.