Skip to content

Instantly share code, notes, and snippets.

@MichaelAquilina
Created August 1, 2014 22:38
Show Gist options
  • Save MichaelAquilina/272f9e6671adfdd2a886 to your computer and use it in GitHub Desktop.
Save MichaelAquilina/272f9e6671adfdd2a886 to your computer and use it in GitHub Desktop.
Project Pre-Commit hook
echo "Running Nose"
nosetests src/tests
# Diff filter ensure sonly Added, Modified or Changed files are listed (not deleted)
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$')
echo "Running PEP8 for:"
echo $FILES
# Only run pep8 if files are being committed
if [ -n "$FILES" ]; then
pep8 $FILES --ignore=E501
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment