CleanFeet
Introduction
CleanFeet is a plugin extension for commitlint, which is a tool for linting commit messages.
If you want to learn more about structured and convention-driven commit messages, see conventional commits
Rules
This plugin adds 2 rules:
-
footer-format
:- This rule determines the format a single footer line has to adhere to by allowing you to specify a set of regular expressions.
- The rule passes in case there is no footer.
-
footer-max-occurrence-breaking-change
:- This rule allows you to specify how many occurrences the footer can contain of
BREAKING CHANGE: <description>
. You're allowed to pass in your own regex[2, 'always', { max: 1, regex: /^BREAKING CHANGE: .*$/ }]
- The rule passes in case there is no footer.
- Specifying
never
has no effect.
- This rule allows you to specify how many occurrences the footer can contain of
Sample configuration
module.exports = {
extends: ['@commitlint/config-conventional'],
plugins: ['cleanfeet'],
rules: {
'footer-format': [
2,
'always',
[
'^BREAKING CHANGE: .*',
'^[a-zA-Z0-9-]+: .*',
'^[a-zA-Z0-9-]+ #.*'
]
],
'footer-max-occurrence-breaking-change': [2, 'always', { max: 1, regex: /^BREAKING CHANGE: .*$/ }]
}
};
Todo
- Show which regular expression has been matched in case of specifying
never
forfooter-format