Skip to content

Instantly share code, notes, and snippets.

@jishnu7
Created September 24, 2015 10:44
Show Gist options
  • Save jishnu7/0cc39e108328fe71ead2 to your computer and use it in GitHub Desktop.
Save jishnu7/0cc39e108328fe71ead2 to your computer and use it in GitHub Desktop.
pre-commit hook for pep8
#!/bin/sh
FILES=$(git diff --cached --name-status | grep -v ^D | awk '$1 $2 { print $2}' | grep -e .py$)
if [ -n "$FILES" ]; then
pep8 -r $FILES
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment