commitlint-config-jira
A recomended config who contain preconfigured rules for jira commits messages style. Part of commitlint-jira monorepo
Getting started.
Install dependencies
npm install --save-dev @commitlint/cli commitlint-plugin-jira-rules commitlint-config-jira
- commitlint-config-jira - is a recomended config who contain preconfigured rules for jira commits messages style. See all rules in description below
- commitlint-plugin-jira - is a plugin that implement all jira commits messages style rules and validate commit messages
Configure commitlint to use jira commits messages style config
module.exports = {
plugins: ['commitlint-plugin-jira-rules'],
extends: ['commitlint-config-jira'],
}
To lint commits before they are created you can use Husky's 'commit-msg' hook
{
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
Rules
jira-task-id-max-length
- this rule check if jira task id length is loonger that the provided value.
// Preconfigured and recomended value in commitlint-config-jira is 8 chars
// ❌ Bad commit messages
git commit -m"IB-2121212121212121: My commit message body"
// ✅ Good commit messages
git commit -m"IB-2121: My commit message body"
jira-task-id-min-length
- this rule check if jira task id length is shorter that the provided value.
// Preconfigured and recomended value in commitlint-config-jira is 4 chars
// ❌ Bad commit messages
git commit -m"I-1: My commit message body"
// ✅ Good commit messages
git commit -m"IB-2121: My commit message body"
git commit -m"IB-21: My commit message body"
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
@Gherciu/commitlint-jira © GHERCIU, Released under the MIT License.
Authored and maintained by GHERCIU with help from contributors (list).
If you like this repository star⭐ and watch👀 on GitHub