Skip to content
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

trailing-whitespace fixer getting false positive #270

Closed
fractos opened this issue Feb 28, 2018 · 6 comments
Closed

trailing-whitespace fixer getting false positive #270

fractos opened this issue Feb 28, 2018 · 6 comments
Labels

Comments

@fractos
Copy link

fractos commented Feb 28, 2018

While 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.

pre-commit-hooks-test-screenshot

@asottile
Copy link
Member

👍 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!

@fractos
Copy link
Author

fractos commented Feb 28, 2018

Awesome! Thanks for the quick turnaround!

@asottile
Copy link
Member

This is available in v1.2.2!

Thanks again for the issue :)

@asottile
Copy link
Member

Oops 1.2.2 is broken -- use 1.2.3 instead :D

@fractos
Copy link
Author

fractos commented Feb 28, 2018

Roger that! Thanks again :D

@fractos
Copy link
Author

fractos commented Mar 1, 2018

Nice one!
trailing-whitespace-hook-fixed

quanpan302 added a commit to IHEProjects/WaterAccounting that referenced this issue Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants