Skip to content

Instantly share code, notes, and snippets.

@kumar303
Created June 16, 2011 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumar303/1030280 to your computer and use it in GitHub Desktop.
Save kumar303/1030280 to your computer and use it in GitHub Desktop.
Checks all changed and new files for pyflakes and pep8 errors (requires check.py)
# Runs new and changed Python files through check.py and other checks
# https://github.com/jbalogh/check
if [ "$1" = "--help" ]; then
echo "usage: `basename $0` [<commit>{0,2}]"
exit 1
fi
if [ "$1" != "" ]; then
REV=$1
fi
git diff $REV --check
git diff --cached --check
git diff $REV --name-status | grep .py | awk '$1 != "R" { print $2 }' | xargs check.py
git diff --cached --name-status | grep .py | awk '$1 != "D" { print $2 }' | xargs check.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment