-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Introduce black linting #6586
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
Introduce black linting #6586
Conversation
webbyfox
commented
Apr 13, 2019
•
edited
Loading
edited
- Added black configuration -> f2eacd3
- Run black to fix formatting -> f418b4e
@tomchristie, Seems like they always released alpha/beta versions till the date as they admit it not stable yet but the number of projects using it. |
So, I really like this, but I am finding it hard to correctly review without having the "introduce to the linting" split out from the "apply black". It might be a good idea for us to start with a failing test case that only adds black into the linting, but doesn't actually apply it. That way I can review it more thoroughly. |
Just throwing in my 2 cents, but I am -1 on black. In general, I'm really biased against black, but I also think it would be somewhat disruptive to introduce it this late into the project's history. Thoughts:
If we do want to go with black though, per the third point, we'd probably want someone from within the org (e.g., @tomchristie) to apply black so we can trust that there aren't any erroneous/additional changes, unintentional or otherwise (e.g., bugs in black). We may also want to consider using |
I think the points re. git history, and impact on large mature codebases are valid. |
OK, @tomchristie, I will create separate PR for applying black configuration soon. |
|
||
ret = renderer.render(self.data, accepted_media_type, context) | ||
if isinstance(ret, six.text_type): | ||
assert charset, ( | ||
'renderer returned unicode, and did not specify ' | ||
'a charset value.' | ||
"renderer returned unicode, and did not specify " "a charset value." |
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.
These two strings can be one now. This is a known upstream bug psf/black#26.
self.assertEqual( | ||
1, | ||
len(s.errors["address"]), | ||
"Unexpected number of validation errors: " "{0}".format(s.errors), |
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.
Same here, can merge.
Closing per #6586 (comment) and the creation of #6630. |