Created
August 1, 2014 22:38
-
-
Save MichaelAquilina/272f9e6671adfdd2a886 to your computer and use it in GitHub Desktop.
Project Pre-Commit hook
This file contains hidden or 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
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