-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
black flake8 incompatibility #2348
Comments
@morenoh149 Thanks again to report another problem. Did you use flake8-black before? I haven't had time to try it yet... If you find a fix for this, feel free to submit a pull-request. |
I have not used that plugin even though it was the first thing to show up for the incompatibility. For now I just removed the precommit with |
@morenoh149 please correct me if I am wrong, but the trailing comma in the dictionary you specify does not serve a purpose, so it should be removed, which will pass flake8 check. In my understanding, you may want to add a trailing comma in a single (or more) element dictionaries, to minimize diffs when inserting new lines. But for that to be true, the dictionary should be written like
EDIT: By the way, here is a relevant issue on Black repository psf/black#274 |
Also see psf/black#1288 |
I'm going to close this, as I don't think there is much we can do on our end, it's an issue that should solved soon in Black. Thanks for the report! |
What happened?
I am using the precommit hooks as instructed at https://cookiecutter-django.readthedocs.io/en/latest/developing-locally.html
I have also chosen black as my formatter in the wizard as well as in my editor. When I go to commit the following form
I get the error
Thats for the CharField trailing comma in the keyword args.
What should've happened instead?
Flake8 should not complain about black's formatting.
Steps to reproduce
[//]: make a cookiecutter app and select black
[//]: install precommit hooks
[//]: make a form like mine and attempt to commit
Solution
Should we add https://github.com/peterjc/flake8-black ?
The text was updated successfully, but these errors were encountered: