Skip to content

Instantly share code, notes, and snippets.

@midhunkrishna
Last active September 11, 2019 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save midhunkrishna/fb904710a606ee5e9ba634dc3c4ac1d4 to your computer and use it in GitHub Desktop.
Save midhunkrishna/fb904710a606ee5e9ba634dc3c4ac1d4 to your computer and use it in GitHub Desktop.
Precommit Hook
#!/bin/bash -l
echo "precommit running"
if (($(git diff --name-only --cached | grep ".rb" | wc -l) > 0)); then
echo "RuboCop autofix running..."
cd ~/vineti-platform/platform && bundle exec rubocop --fail-level A -a
exit $?
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment