I am trying to use issue prefix to have my commit format as mentioned below
JIRA-ID: type(scope): Subject
scope should be optional. which means following are valid message
AAAA-12: fix(test): fixed the failing test
AAAA-12: fix: fixed the failing test
Following is how my commitlint.config.js looks like
module.exports = {
extends: ['@commitlint/config-conventional'],
parserPreset: {
parserOpts: {
headerPattern: /^[A-Z]{1,4}-[0-9]{1,4}:\s(\w*)\((\w*)\):\s(.*)$/,
headerCorrespondence: ["type", "scope", "subject"],
issuePrefixes: ["^[A-Z]{1,4}-[0-9]{1,4}"],
referenceActions: ["xxx-"] // (!!)
}
},
rules: {
'references-empty': [2, 'never'],
'scope-empty': [1, 'never'],
...
...
}
}
the following message appears to be invalid.
AAAA-12: fix: fixed the failing test
it forces me to use empty parenthesis as mentioned below.
AAAA-12(): fix: fixed the failing test