Created
October 28, 2014 18:18
-
-
Save brouberol/ad03a94eb0422b50e888 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Check for uncommented debug patterns (pdb, ipdb, rdb) in python files. | |
# If such patterns are matched, prevent the commit | |
PATTERN="^[^#]*(i?pdb|rdb)" | |
debug_statements=`ack $PATTERN --py` | |
if [ -z "$debug_statements" ];then | |
exit 0 | |
else | |
echo "Commit aborted. Uncommented debug statements found:" | |
echo "$debug_statements" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment