trailing-whitespace fixer getting false positive
See original GitHub issueWhile bringing some Terraform files under pre-commit control, I’ve noticed an issue with files that do not have trailing whitespace but which are being flagged as needing fixing by the trailing-whitespace
hook, which is causing a Travis CI build to fail unexpectedly. The files in question seem to trigger because they do not end in a newline, and I believe this to be incorrect behaviour for this hook.
Example repo: https://github.com/digirati-co-uk/pre-commit-hooks-test
This is using v1.2.1 of the pre-commit-hooks repo.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
what is trailing whitespace and how can I handle this?
Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline. In your posted question, there...
Read more >Re: [sonar-dev] [SONARJS] Avoid trailing whitespaces
This is an open defect in eclipse stating that there is currently no way to get eclipse to quit adding the whitespace on...
Read more >Life is Too Short to Review Spaces - GitGuardian Blog
We chose this tool because it is based on a list of common typos, which reduces the number of false positives to a...
Read more >Whitespace: The Silent Killer - Coding Horror
I have read the comments and I understand that this whitespace can trigger false positives when comparing two versions of a same file...
Read more >What coding practices are most useful dealing with trailing ...
One of the chronic issues we deal with is code that string comparisons often fail because the stored field may or may not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👍 thanks for the great report.
This is indeed a problem with the hook, I’ll see if I can’t get a fix out for it 😃
Fixing end-of-file is the job of
end-of-file-fixer
so this hook shouldn’t be doing that!Nice one!