-
Notifications
You must be signed in to change notification settings - Fork 263
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
style: run github.com/psf/black #554
Conversation
88d3a38
to
6c6686f
Compare
It is a good idea, I assume they solved the problem that horizontal indentation in python is sematically relevant since it defines the scope of if and for loops. |
They did. The main discussion we need to have regarding this issue is: do we want to use a heavily opinionated formatter ( At first sight, I prefer |
My opinion about style and formatting is that is one of the most low value things to argue about :-) Most modern languages have autoformatters precisely because there should be one and only one way since it does not matter (within reason) how it looks just that it is the same for all developers. Python was one of the early languages to think in this way with PEP8 but they did not create an autoformatter rather a checker. Autoformatter is better then a checker since it automatically fixes the issues. I really like rustfmt when coding Rust which works the same. |
We completely agree :D. It is almost annoying to work with Python, VHDL or C, once you get used to prettier, gofmt, rustfmt, etc. Nevertheless, let's wait until we publish the next release before merging this. On the one hand, we won't disturb the PRs that are 'milestoned'. On the other hand, it will give me some time to add it to the CI pipelines. |
This is ideally something you do when there is not a lot of Python changes outside of master in various PR:s. |
I'm all for introducing this. If we want to keep style discussions to a minimum we should avoid tools allowing configuration so Black seems to be a good choice. It's also developed by one of the Python core developers and has the best momentum. If there will be a future Python standard this is probably the best bet. |
Now is a good time to do this. It should be added as a test to CI like pycodestyle and pylint though. |
bad49e5
to
58f5fd6
Compare
I updated the PR and I added Note that subdir |
58f5fd6
to
f71caf9
Compare
f71caf9
to
8b80469
Compare
This is a proof of concept about adding a default python formatter.