Github CommitLink无法使作用域成为可选的
我正在尝试使用问题前缀来获得我的提交格式,如下所述Github CommitLink无法使作用域成为可选的,github,commit,github-actions,Github,Commit,Github Actions,我正在尝试使用问题前缀来获得我的提交格式,如下所述 JIRA-ID: type(scope): Subject 范围应该是可选的。 这意味着以下是有效的消息 AAAA-12:修复(测试):修复了失败的测试 AAAA-12:修复:修复了失败的测试 下面是我的commitlint.config.js的样子 module.exports = { extends: ['@commitlint/config-conventional'], parserPreset: {
JIRA-ID: type(scope): Subject
范围应该是可选的。
这意味着以下是有效的消息
- AAAA-12:修复(测试):修复了失败的测试
- AAAA-12:修复:修复了失败的测试
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'],
...
...
}
}
以下消息似乎无效
AAAA-12: fix: fixed the failing test
AAAA-12(): fix: fixed the failing test
它迫使我使用空括号,如下所述