Last active
July 15, 2019 10:08
-
-
Save sevenmaxis/eb8232b7ed7fd66ad0f807c6fa09c995 to your computer and use it in GitHub Desktop.
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
# cd into project | |
# To bypass this hook, pass --no-verify or -n option | |
# Pre-push hook | |
echo -e '#!/bin/bash\ngit ls-files -m | xargs ls -1 2>/dev/null | xargs rubocop' > .git/hooks/pre-push | |
# Pre-commit commit | |
echo -e '#!/bin/bash\nrubocop' > .git/hooks/pre-push | |
chmod +x .git/hooks/pre-push | |
chmod +x .git/hooks/pre-commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://medium.com/devnetwork/running-rubocop-only-on-modified-files-a21aed86e06d