Here's how this works:
- Include a
git_hooks/directory in your project, with these two files (plus other hooks if you want, written in a similar style). - Add
"npm"to yourdevDependenciesinpackage.json, so that thepre-commithook can do its magic. - Add
testandlintscripts to yourpackage.json, e.g.
"scripts": {
"test": "mocha",
"lint": "jshint ./lib --show-non-errors"
}- Whenever you clone the repository, run
node git_hooks/link.jsto symlink the hooks stored in the repository, ingit_hooks, to the hidden.git/hooksdirectory.