Created
December 16, 2016 14:25
-
-
Save lucivaldo/1caacfd0e516ec7e96ec3a3d6765e0f7 to your computer and use it in GitHub Desktop.
Script Ruby executado antes de efetuar o commit para interromper caso houver código de debug
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
#!/usr/bin/env ruby | |
require 'colorize' | |
files_with_debug = `git diff --name-only --cached | xargs grep -EH '^[^#]*binding.pry' | cut -d':' -f 1` | |
unless files_with_debug&.strip&.empty? | |
puts 'Tem código de debug nos seguintes arquivos:' | |
puts files_with_debug | |
exit(1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment