This is just a repository of useful git
hook scripts that I've found and / or modified for use in various projects.
Other (better) folks than I have written better documentation about installing a git
hook than I. Check out the git documentation on git hooks for more details.
-
pre-commit-reject-forbidden-code
This bash script hook checks for the presence of certain undesirable code snippets in the code being checked in and rejects the commit if it contains any of the following:
- console methods - the assumption is you should be using something else to handle logging,
personally I like Bunyan
console.log
console.warn
console.info
console.error
debugger
var_dump
print_r
fdescribe
ddescribe
fit
iit
- console methods - the assumption is you should be using something else to handle logging,
personally I like Bunyan