Version control system hooks that can help you when developing javascript project.
don't let you commit if any of commited files contain
debugger
statement- focused jasmine test (
fit
statement) or test unit (fdescribe
statement)
Install package
npm install -g horaklukas/vcs-hooks
or
yarn global add horaklukas/vcs-hooks
Use vcs-hooks
bin to instal files into repository, eg.
vcs-hooks /srv/git/my-repo
or
vcs-hooks C:/mercurial/my-repo
Relative paths instead of absolute can be used as well.
If from any reason is not possible, you can try manual installation, but use it as a last option in case automatic install does not work.
Currently supported VCS:
- Git
- Mercurial
If from any reason is desired to not run hooks, modify VCS command.
For Git add --no-verify
option, for example
git commit -a --no-verify -m 'New features'
For Mercurial add --config 'hooks.precommit='
option, eg.
hg commit --addremove --config 'hooks.precommit=' -m 'Fix bugs'
- installation script