Created
March 13, 2015 09:32
-
-
Save bquorning/19ae41cc1222ec2cdf54 to your computer and use it in GitHub Desktop.
.git/hooks/pre-commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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