-
-
Notifications
You must be signed in to change notification settings - Fork 719
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 not working #250
Comments
Can you produce the full output of your |
Also, did you actually install the pre-commit hook to your git repo (e.g. run |
The exact string @chriskuehl, Yes,
|
@revolter perplexing! It seems that Can you try this while a file is staged
|
also can you produce:
|
and it removed the trailing space of that file in the working tree.
|
ok so the script works as expected, now to figure out why git isn't committing as expected :S Maybe it's something in gitconfig? Also might be useful:
|
Found the culprit, I previously (some months ago) changed the git |
Also, the desired behaviour is for it to change the working tree, and after manually reviewing the changes that |
Yep, this approach was taken as hooks can sometimes be wrong and it allows the human some chance to double check the machine. |
Maybe this could be added to a FAQ? |
fwiw, I think we're going to handle As for the modification faq bit I'd love to add something more to the documentation about this. The current docs briefly mention that modification is considered a failure, but don't really go in depth on the rationale: http://pre-commit.com/#new-hooks If you'd like to contribute something in that direction, the docs are hosted via github pages: https://github.com/pre-commit/pre-commit.github.io |
Also, big thanks for this issue, definitely something I hadn't even considered before 👏 |
Neither did I 😂 We go lucky I found it by mistake and fixed it easily, so others wouldn't suffer. |
I just installed
pre-commit
, added this.pre-commit-config.yaml
file:and added a trailing space to a line in a file in the project, staged it, and when I commit it, it commits with the space, instead of removing it.
The text was updated successfully, but these errors were encountered: