Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created May 26, 2011 15:54
Show Gist options
  • Save eqdw/993404 to your computer and use it in GitHub Desktop.
Save eqdw/993404 to your computer and use it in GitHub Desktop.
pre-commit hook to prevent
#!/usr/bin/env ruby
result = `grep -rls "debugger" *`
results = result.split("\n").reject{ |res| res =~ /\.log\s*$/ || res =~ /^\s*$/}
if results.length > 0
puts "NEVER DO THIS AGAIN. THERE ARE DEBUG STATEMENTS IN THE CODEBASE"
puts "offending files:"
results.each do |r|
puts " #{r}"
end
exit(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment