Created
June 17, 2014 14:47
-
-
Save lorefnon/429d86160129c9e6ca32 to your computer and use it in GitHub Desktop.
pre-commit hook to check for debugger invocations in ruby source.
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
echo "\n--" | |
echo "Checking for debugger calls" | |
echo "--\n" | |
for name in `git diff --name-only --cached` | |
do | |
echo "Analysing: $name" | |
cat $name | egrep -n "\b(byebug|binding.pry|debugger)\b" | while read line | |
do | |
echo " -> $line" | |
echo "\n--" | |
echo "Commit Aborted" | |
echo "--\n" | |
exit 1 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment