In addition to the above guidelines, it will prevent committing of messages which could skip CI pipelines.
npm install --save-dev @dwp/commitlint-config-base @commitlint/cli
commitlint.config.js file that looks something like:
module.exports = require( '@dwp/commitlint-config-base' );
You can add your own rules to enhance this, but in doing so please ensure you don't weaken the baseline ruleset.
commitlint to your test suite like this, or see our package.json for an example of how we do it:
"test": "commitlint --from=develop --to=HEAD"