Skip to content

Instantly share code, notes, and snippets.

@simon-weber
Created July 29, 2015 19:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simon-weber/b056db8cfa81e08ac67d to your computer and use it in GitHub Desktop.
Save simon-weber/b056db8cfa81e08ac67d to your computer and use it in GitHub Desktop.
venmo linting pre-commit
#!/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