Create a gist now

Instantly share code, notes, and snippets.

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