Skip to content

Instantly share code, notes, and snippets.

@rizumu
Created July 8, 2013 15:21
Show Gist options
  • Save rizumu/5949773 to your computer and use it in GitHub Desktop.
Save rizumu/5949773 to your computer and use it in GitHub Desktop.
pep8 git pre-commit hook
#!/bin/sh
# Auto-check for pep8 so I don't check in bad code
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$')
if [ -n "$FILES" ]; then
flake8 --max-line-length=100 $FILES
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment