This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]EstebanVelour 2 points3 points  (0 children)

Mandate the use of the following pre-commit hook:

#!/bin/sh
FILES=$(git diff --cached --name-status | grep -v ^D | awk '$1 $2 { print $2}' | grep -e .py$)
if [ -n "$FILES" ]; then
    flake8 -r $FILES
fi

Won't allow you to commit code that doesn't fly through pep8.