Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
.git/hooks/pre-commit
#!/bin/sh
STAGED=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.rb$' -e '\.rake$' -e '\.ru$' -e Capfile -e 'Gemfile$')
if [ "$STAGED" ]; then
./bin/rubocop -- $STAGED
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.