jish / pre-commit

A slightly improved pre-commit hook for git
https://jish.github.io/pre-commit/
Other
796 stars 96 forks source link

Debugger False Positive #138

Closed jfelchner closed 10 years ago

jfelchner commented 10 years ago

When executing the debugger check, if the word 'debugger' exists anywhere in the file the commit fails. The check should be more like this:

/^\s*debugger/

That will catch almost all usages of 'debugger' without getting the tons of false positives like when it's mentioned in comments, TODOs, documentation, as a symbol :debugger or inside of a string ("Make sure to enable the debugger if you're unsure of what this code does").

mpapis commented 10 years ago

just open PR with this change https://github.com/jish/pre-commit/blob/master/lib/plugins/pre_commit/checks/debugger.rb#L16

mpapis commented 10 years ago

did you try the proposed fix?

jfelchner commented 10 years ago

@mpapis apologies, I'm using overcommit now. I'll close this.

jish commented 10 years ago

Fixed in https://github.com/jish/pre-commit/commit/d1443980278f5fc7ac21af264546d20bf23a9fc9