-
Notifications
You must be signed in to change notification settings - Fork 245
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
Problem with running pronto in a pre-commit hook #263
Comments
@grodowski thanks for reporting the issue! 🙇 Managed to reproduce it by following the steps you've outlined. Tried a couple of other cases and it shows warnings when using
It also shows error when using
That was an AHA moment for me. One workaround that works: having two pre-commit scripts. One for @prontolabs/core I also wonder if we should support an option that covers both |
Just faced this issue. Using master to resolve Rugged::TreeError. As a workaround I run pronto second time for new files: bundle exec pronto run --index --exit-code
new_files=`git diff --cached --name-status | (grep -E "^[A]" || true) | cut -f2-`
[ -n "$new_files" ] && bundle exec pronto run --staged --exit-code However 1st call checks not staged files too. |
@mmozuras I've been working on a coverage tool that integrates with git (and Pronto), which combines |
Hey!
I have run into a problem with setting up pronto as a
pre-commit
git hook.Given there are new rubocop warnings and I have the below script in
.git/hooks/pre-commit
...Pronto does what is expected and shows the rubocop warnings when I run:
But unfortunately I get no rubocop output and a false-positive exit status 0 on
git commit -am "test"
This is strange and I've been trying to understand the reason. Traced it back to the below line, where
rugged
returns an empty diff for thestaged
option (just in the second use case).pronto/lib/pronto/git/repository.rb
Line 15 in e97cb2b
Any help would be welcome!
Edit: I am using pronto 0.9.5
The text was updated successfully, but these errors were encountered: