Command to check before actually committing
Closed this issue · 9 comments
I sometimes find myself wanting to run the checks on the entire codebase without actually committing and/or staging any files. This would enable me to find and fix issues before actually trying to commit them. For example
pre-commit check # same as ...
pre-commit check --staged # runs checks against staged files
pre-commit check --all # runs checks against all files
The pre-commit check
command could be reused inside the actual git hook instead of hard-coding Ruby code in there. What do you think?
+1 for command, -1 for reusing it in hook - this could introduce number of problems, we got it working as it is, but we could try it if someone has time to test all the scenarios
finally got the tests working, should be safe to test / release beta now
@mpapis thanks a bunch! I was not actually expecting you to implement it, I was rather trying to ask whether you would be interested in a PR. I will definitely check it out on all my repos using pre-commit today!
trying yo clean up my tickets queue, this one looked like one of the easier ones so I implemented it ;)
👍 Works great for me. Thanks again!
@jish ok then, it lacks tests but works fine :) good to release version, no need for beta
Released 0.17.0
https://rubygems.org/gems/pre-commit
closing the ticket as it works and we have a release for it, please let us know if you need any more help