Add EOF and trailing whitespace fixer to pre-commit config#2330
Merged
JelleZijlstra merged 2 commits intoJun 13, 2021
Conversation
ichard26
approved these changes
Jun 13, 2021
Collaborator
ichard26
left a comment
There was a problem hiding this comment.
I'm all for less pointless discussion regarding trailing whitespace :D
Thank you again!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unix tools often rely upon the files ending with a newline character to show the output properly (e.g. when the file has no newline at the end,
cat filewill cause the prompt to show right after its output without a newline in between). This may help minimize the diffs and ensures consistency across all files.I've also added auto-removal of trailing whitespace since I don't think that outside of test data (which is excluded from pre-commit) anyone would actually want to have trailing whitespace in their files. Let me know if that's not something that you want though.
I am doing this PR because I've seen that people were basically wasting their time on this problem during review here and this could prevent that in the future.