Skip to content

Instantly share code, notes, and snippets.

@ohe
Created June 15, 2011 16:50
Show Gist options
  • Save ohe/1027527 to your computer and use it in GitHub Desktop.
Save ohe/1027527 to your computer and use it in GitHub Desktop.
Launch flake8 for pre-commit hook
#!/bin/bash
for file in `git diff --name-only --cached`
do
flake8 $file
if [ $? == 0 ]
then
ret_code=0
else
ret_code=1
fi
done
exit $ret_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment