This repo aims at setting up a quick example of how you can properly keep a commit message convention and tools to enforce the messages. These tools also help generate a changelog very easily from these nicely crafted commit messages.
First ensure you have Node installed.
Install local node modules: npm install
.
Install commitizen
- npm install -g commitizen
.
This will set you up for following a commit message convention (linked is the commit message convention for AngularJS).
This aims at enforcing commit messages so we get beautiful easy to read changelogs!
commitizen
- prompts to fill out any required commit fields at commit timecz-conventional-changelog
- commitizen adapter for the angular preset of conventional-changelogHusky
- running git hooks from npm made easyvalidate-commit-msg
- git hooks to validate git commit messages based on convention(s)
If you type git cz
, you will be prompted with steps to guide you along to crafting a nice commit message that follows the convention.
If you do not, there will be git hooks that run (via the npm run script commitmsg
that runs validate-commit-msg
) and be alerted with a warning to correct your commit message.
To generate the changelog, type npm run changelog
, and view the changelog.
Enjoy!