-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Clean up all whitespace throughout project #5578
Conversation
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.
OK. This looks good. The sort of thing I'm all for really...
- Could we add an editor config file to help force editors to behave nicely. (1a: Is the support for that widespread enough to make it worth it?)
- Do we want to enforce this at the lint step?
Added an root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
I'm open to this idea. Did you have a particular tool in mind? I'm not aware of one that checks across all these different file types for whitespace issues. So this has not yet been added. |
No. 😃 I'm in two minds about it. I suspect we'd end up with a lot of failures — we get plenty with I'll leave this open for a bit, to see if there are any comments, otherwise we'll have this I think. Thanks for the input! |
@@ -1,7 +1,7 @@ | |||
# SOME DESCRIPTIVE TITLE. | |||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | |||
# This file is distributed under the same license as the PACKAGE package. | |||
# | |||
# |
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'm not familiar with transifex so I might be wrong here, but aren't the .po files regenerated by transifex for every release? It seems like the whitespace changes there would be superfluous.
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.
@rpkilby Yes. That's we all the po
files and the compilemessages
from those. Good catch.
They won't ever be hand edited I'd guess.
* Remove trailing whitespace from lines * Remove trailing nad leading whitespace from files Allows for cleaner diffs in future changes. For editors that automatically clean up whitespace on save, will avoid unrelated line changes in diffs.
Updated to remove changes to |
I have enforced this with flake/pep on a project at work, and I've had almost no issues with this. |
Hi @anx-ckreuzberger. Python files are already covered by flake8. Does your config include markdown or other non-python files? |
Ah, I guess I misunderstood the comment from above. I actually do not lint other non-python files, though I do use a little "bigger" editor config:
I also use eslint for linting JavaScript, though I guess that's a little too much for DRF. |
* Remove trailing whitespace from lines * Remove trailing nad leading whitespace from files Allows for cleaner diffs in future changes. For editors that automatically clean up whitespace on save, will avoid unrelated line changes in diffs.
Allows for cleaner diffs in future changes. For editors that automatically clean up whitespace on save, will avoid unrelated line changes in diffs.