Skip to content

Add EOF and trailing whitespace fixer to pre-commit config#2330

Merged
JelleZijlstra merged 2 commits into
psf:mainfrom
Jackenmen:add-eof-fixer-to-precommit-config
Jun 13, 2021
Merged

Add EOF and trailing whitespace fixer to pre-commit config#2330
JelleZijlstra merged 2 commits into
psf:mainfrom
Jackenmen:add-eof-fixer-to-precommit-config

Conversation

@Jackenmen
Copy link
Copy Markdown
Contributor

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 file will 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.

@ichard26 ichard26 added the ci: skip news Pull requests that don't need a changelog entry. label Jun 13, 2021
Copy link
Copy Markdown
Collaborator

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm all for less pointless discussion regarding trailing whitespace :D

Thank you again!

@JelleZijlstra JelleZijlstra merged commit 52f402d into psf:main Jun 13, 2021
@Jackenmen Jackenmen deleted the add-eof-fixer-to-precommit-config branch June 13, 2021 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: skip news Pull requests that don't need a changelog entry.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants