java-husky-commitizen-maven-spotless-example
npm install husky --save-dev
Add a hook
npx husky add .husky/pre-commit "mvn spotless:check"
npm install --save-dev @commitlint/{cli,config-conventional,prompt-cli}
echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
see https://typicode.github.io/husky/guide.html#test-hooks
git commit -m "new: initial commit"
⧗ input: new: initial commit
✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]
✖ found 1 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
husky - commit-msg hook exited with code 1 (error)
see https://github.com/conventional-changelog/commitlint/#what-is-commitlint
git commit -m "yolo!" --no-verify
npm install -g commitizen
commitizen init cz-conventional-changelog --save-dev --save-exact
git cz
git commit -m "override cz" --no-verify
https://typicode.github.io/husky/#/?id=install