Skip to content

Instantly share code, notes, and snippets.

@BigBlueHat
Created July 6, 2012 14:07
Show Gist options
  • Select an option

  • Save BigBlueHat/3060343 to your computer and use it in GitHub Desktop.

Select an option

Save BigBlueHat/3060343 to your computer and use it in GitHub Desktop.
Super simple git pre-commit hook for pep8 & pyflakes checking
#!/bin/sh
FILES=$(git diff --cached --name-status | awk '$1 $2 { print $2}' | grep -e \.py$)
if [ -n "$FILES" ]; then
pep8 -r $FILES
pyflakes $FILES
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment