Created
July 29, 2015 19:47
-
-
Save simon-weber/b056db8cfa81e08ac67d to your computer and use it in GitHub Desktop.
venmo linting 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 | |
GITROOT=`git rev-parse --show-toplevel` | |
EXIT_STATUS=0 | |
# Lint all the files in the index, excluding deletions and directories. | |
git diff-index -z --cached --name-only --diff-filter='ACMRTUXB' HEAD | xargs -0 ls -dp | grep -v '/$' | xargs "$GITROOT/lint" | |
if [ "$?" != "0" ]; then | |
echo "Files did not pass linting."; | |
EXIT_STATUS=1 | |
fi | |
exit $EXIT_STATUS; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment