Write intelligible commit messages, by answering questions
Use @commitlint/prompt-cli instead.
npm install --save-dev komet komet-karma
You have a file .commitrc.js
at the root of your project.
This file contains an array of plugins:
module.exports = [
'karma',
]
With git hook
create .git/hooks/prepare-commit-msg
#!/bin/sh
# Allow to read user input, assigns stdin to keyboard
exec < /dev/tty
case "$2," in
message,|template,|,)
node_modules/.bin/prepare-commit-msg --path "$1"
;;
*) ;;
esac
commit
All args are passed to git commit.
Edit your package.json:
{
"scripts": {
"commit": "commit",
}
}
questions
are the questions which are going to be asked to create your commit message (it uses Inquirer)
processAnswers
is a function which build and return the commit message.
You can check how works karma
plugin here
- conventional-changelog - Generate a changelog from git metadata
- commitizen - Simple commit conventions for internet citizens.
- angular-precommit - Pre commit with angular conventions