Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# added to .git-hooks/pre_commit/debugger.rb
module Overcommit::Hook::PreCommit
# Check for Debugger
class Debugger < Base
def run
keywords = config['keywords']
result = execute(command, args: [keywords.join('|')] + applicable_files)
unless result.stdout.empty?
extract_messages(
result.stdout.split("\n"),
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/,
lambda { |_type| :warning }
)
return :fail, "Debugger detected:\n#{result.stdout}"
end
:pass
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.