running flake8 in git’s pre-commit

I’m forever forgetting to remove debug statements or to run flake8 on my source code. Not to panic though, git hooks to the rescue!

You can just put pre-commit into $PROJECT_DIR/.git/hooks, chmod +x it and be away.

This is the useful part of the file;

ret_code=0 ...
more ...