Trim trailing whitespace#5406
Conversation
|
I'm not sure how to review this. |
|
Hmm, since these are all automatic fixes by the hook, if I were reviewing I’d just check it’s just mechanical changes (bar hook addition). I’d probably just run the hook locally and compare the local changes to the PRs. |
|
How about rolling back the changes and keeping the hook (which should only run on changed files)? |
|
IMO that just makes it a long term nuisance, touch some file and suddenly you have several unrelated changes, making many more PRs harder to review. |
|
I don't trust the tools enough to blindly merge a huge change like this. Maybe break it into smaller pieces? Or only reformat files we are anyway touching? |
I’ve done far more with sed on prod servers;-) I see, I went through the diff (quite „efficiently,” but since the changes are so straightforward it’s easy to read), and I didn’t see any issues, I also can’t think of a way a something could be relying on trailing whitespace in a file, it’s not indentation after all.
My opinion on this: #5406 (comment) |
| # offset 0 | ||
| s = """\ | ||
| eb284000-eb285000 rw-p 00000000 00:00 0 | ||
| eb284000-eb285000 rw-p 00000000 00:00 0 |
There was a problem hiding this comment.
I am generally in favor of such changes. however this hunk shows the limits of just removing all trailing whitespace: removing trailing whitespace in a triple-quoted string is potentially quite wrong.
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
we must definitely exclude lib-python from these rules, we don't want merge conflicts with upstream stdlib changes due to whitespace stuff.
There was a problem hiding this comment.
Upstream stdlib should not have any such trailing whitespace, there are CI checks for that.
There was a problem hiding this comment.
This PR only touches lib-python/2.7, I don't think that is updated?
This adds and runs the
trailing-whitespacepre-commit hook, which well, trims trailing whitespace. There is quite a lot, across 500 files.Thank you for contributing to PyPy. Please be sure to target one of our active branches:
mainfor pypy2.7, rpython, and documentation changespy3.10for the legacy python3.10 branchpy3.11for the current development branch targeting python3.11Do not target the
branch/*branches, they are artifacts of our migration from mercurial to git.