Created
August 3, 2017 23:41
-
-
Save jppommet/6ae749bf5a9cb71c0d1e284fad4f561c to your computer and use it in GitHub Desktop.
git pre-commit hook rubocop ruby modified/staged files
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 | |
#TODO: add exclude <file>.rb in rubocop.yml ? | |
git status --porcelain | egrep "^(A|AM|^M).+\.rb$" | awk '{print $NF}' | xargs rubocop -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment