-
Notifications
You must be signed in to change notification settings - Fork 301
Format code with black #857
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
Comments
@n2ygk What do you think about this? I have added black configuration to other projects as well so I could follow up with a PR. As this is larger change though I think it is good to get some consensus before i get started. |
I'm OK with complying with whatever the rules are, but I'm personally cringing at: "88 characters per line and double quotes".... Most projects I work on seem to feel comfortable with line length 120. And single quotes don't require holding down the shift key, at least on a US keyboard. Also it looks like PyCharm's built-in formatting does not yet support Black-style. It was planned for the current release (2020.2) but got removed from that release. You can run black on file save hook but that's not the same as having the IDE implement the style as I type... So I'm not super-excited but will follow your lead. |
Thanks for your thoughts. We should not enforce something which makes working on DJA harder then it should. However before I started to use black I also had some doubts about it and now I miss black any time a project is not using it. Some thoughts:
Does this makes sense to you? I am also open to wait a bit more using black in DJA till |
Sure, let's give it a shot and keep the default 88 for now and see how it goes. pre-commit hook is a good idea. PyCharm can run black on save so it might be OK. I wonder how that works since PyCharm saves automatically... I guess I can git it a try soon;-) |
I will see when I get to this. It is easiest though when there are no other PRs open when we do this to avoid merge conflicts. Current open PRs should be merged soon though. |
Django project proposed to format code with black.
I have been using black in many other projects and had very good experiences with it. As I am currently working on converting tests I very much missed black as a couple of times I had to format code to finally suite flake8 instead of concentrating on coding.
The proposal outlines very well the pros and cons and why Django decided to prose using black.
The text was updated successfully, but these errors were encountered: