- Date: 2018-06-19
Handling and applying git hooks is a common tasks in most projects. Keeping the handling (esp. installation) of git hooks is however mosten an complicated matter.
- do not add tooling for supporting git hooks
- provide a custom node script + templates for installing hooks
- use husky
- …
Use husky for installing and configuring git hooks
Reasons
- provides an painless and consistent approach to handling git hooks
- well documented, adopted and maintained
- easily configurable
[example | description | pointer to more information | …]
- husky
- configuration example
{
"husky": {
"hooks": {
"commit-msg": "npm run commitlint",
"push": "npm run lint"
}
}
}