Skip to content

Instantly share code, notes, and snippets.

@alexbrinkman
Created April 20, 2020 16:59
Show Gist options
  • Save alexbrinkman/376d77455bace27d488c8551b1c8346c to your computer and use it in GitHub Desktop.
Save alexbrinkman/376d77455bace27d488c8551b1c8346c to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
if `grep -rls --include "*.rb" --include "*.js" "debugger" .` != ""
puts "A debugger statement was found, remove before committing."
exit(1)
end
if `grep -rls --include "*.rb" "binding.pry" .` != ""
puts "A pry statement was found, remove before committing."
exit(1)
end
if `grep -rls --include "*.rb" "<<<<<<<" .` != ""
puts "A git merge statement was found (<<<<<<<), remove before committing."
exit(1)
end
if `grep -rls --include "*.rb" ">>>>>>>" .` != ""
puts "A git merge statement was found (>>>>>>>), remove before committing."
exit(1)
end
if `grep -rls --include "*_spec.rb" "save_page" .` != ""
puts "A save_page statement was found, remove before committing."
exit(1)
end
if `grep -rls --include "*_spec.rb" "save_and_open_page" .` != ""
puts "A save_and_open_page statement was found, remove before committing."
exit(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment