Created
June 15, 2011 16:50
-
-
Save ohe/1027527 to your computer and use it in GitHub Desktop.
Launch flake8 for pre-commit hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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