Closed huizhang001 closed 1 year ago
Please update latest version v1.7.0 and test
npm install -g czg@latest
# or
npm install -D czg@latest
我是用在go项目里的,用brew最方便吧,brew的最新版本是1.3.9
brew install czg
brew install czg
brew install czg
// .commitlintrc.js
/** @type {import('czg').UserConfig} */
module.exports = {
rules: {
// @see: https://commitlint.js.org/#/reference-rules
},
prompt: {
alias: {fd: 'docs: fix typos'},
messages: {
type: '选择你要提交的类型 :',
scope: '选择一个提交范围(可选):',
customScope: '请输入自定义的提交范围 :',
subject: '填写简短精炼的变更描述 :\n',
body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
markBreaking: '是否重大变更 ?\n',
footerPrefixesSelect: '选择关联issue前缀(可选):',
customFooterPrefix: '输入自定义issue前缀 :',
footer: '请输入需求/任务地址 :\n',
confirmCommit: '是否提交或修改commit ?'
},
types: [
{value: 'Feat', name: 'Feat: 新增功能'},
{value: 'Fix', name: 'Fix: 修复缺陷'},
{value: 'Docs', name: 'Docs: 文档更新'},
{value: 'Style', name: 'Style: 代码格式'},
{value: 'Refactor', name: 'Refactor: 代码重构'},
{value: 'Perf', name: 'Perf: 性能提升'},
{value: 'Test', name: 'Test: 测试相关'},
{value: 'Build', name: 'Build: 构建相关'},
{value: 'CI', name: 'CI: 持续集成'},
{value: 'Revert', name: 'Revert: 回退代码'},
{value: 'Other', name: 'Other: 其他修改'},
],
useEmoji: false,
emojiAlign: 'center',
useAI: false,
aiNumber: 1,
themeColorCode: '',
scopes: [
{value: 'admin', name: 'admin'},
],
allowCustomScopes: false,
allowEmptyScopes: false,
customScopesAlign: 'bottom',
customScopesAlias: 'custom',
emptyScopesAlias: 'empty',
upperCaseSubject: false,
markBreakingChangeMode: true,
allowBreakingChanges: ['feat', 'fix'],
breaklineNumber: 100,
breaklineChar: '|',
skipQuestions: [],
issuePrefixes: [
{value: '需求/任务地址: ', name: '需求/任务地址'},
],
customIssuePrefixAlign: 'top',
emptyIssuePrefixAlias: '跳过',
customIssuePrefixAlias: '自定义',
allowCustomIssuePrefix: false,
allowEmptyIssuePrefix: false,
confirmColorize: true,
maxHeaderLength: Infinity,
maxSubjectLength: Infinity,
minSubjectLength: 0,
scopeOverrides: undefined,
defaultBody: '',
defaultIssues: '',
defaultScope: '',
defaultSubject: '',
}
}
thank you!!!!!, 切换了下brew的源,install下来的是最新包了。。。。
✅ Checklist
📄 System Info
🔎 Description
您好:
并不生效!!!
我项目的配置:![image](https://github.com/Zhengqbbb/cz-git/assets/26496638/47709df8-694e-4a8f-8b2e-553e17c33d5a)
实际效果:![image](https://github.com/Zhengqbbb/cz-git/assets/26496638/308f444f-0d8d-4c6b-9ae3-f5d62d0eb0d3)
我预期不选择直接:footerPrefix=需求/任务地址 。。实际还让我选,并且配置的issuePrefixes也没有生效。
版本: czg 1.3.9
完整配置
// .commitlintrc.js /* @type {import('cz-git').UserConfig} / module.exports = { rules: { // @see: https://commitlint.js.org/#/reference-rules }, prompt: { alias: {fd: 'docs: fix typos'}, messages: { type: '选择你要提交的类型 :', scope: '选择一个提交范围(可选):', customScope: '请输入自定义的提交范围 :', subject: '填写简短精炼的变更描述 :\n', body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n', breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n', markBreaking: '是否重大变更 ?\n', footerPrefixesSelect: '选择关联issue前缀(可选):', customFooterPrefix: '输入自定义issue前缀 :', footer: '请输入需求/任务地址 :\n', confirmCommit: '是否提交或修改commit ?' }, types: [ {value: 'Feat', name: 'Feat: 新增功能'}, {value: 'Fix', name: 'Fix: 修复缺陷'}, {value: 'Docs', name: 'Docs: 文档更新'}, {value: 'Style', name: 'Style: 代码格式'}, {value: 'Refactor', name: 'Refactor: 代码重构'}, {value: 'Perf', name: 'Perf: 性能提升'}, {value: 'Test', name: 'Test: 测试相关'}, {value: 'Build', name: 'Build: 构建相关'}, {value: 'CI', name: 'CI: 持续集成'}, {value: 'Revert', name: 'Revert: 回退代码'}, {value: 'Other', name: 'Other: 其他修改'}, ], useEmoji: false, emojiAlign: 'center', useAI: false, aiNumber: 1, themeColorCode: '', scopes: [ {value: 'admin', name: 'admin'}, ], allowCustomScopes: false, allowEmptyScopes: false, customScopesAlign: 'bottom', customScopesAlias: 'custom', emptyScopesAlias: 'empty', upperCaseSubject: false, markBreakingChangeMode: true, allowBreakingChanges: ['feat', 'fix'], breaklineNumber: 100, breaklineChar: '|', skipQuestions: [], issuePrefixes: [ {value: '需求/任务地址: ', name: '需求/任务地址'}, ], customIssuePrefixAlign: 'top', emptyIssuePrefixAlias: '跳过', customIssuePrefixAlias: '自定义', allowCustomIssuePrefix: false, allowEmptyIssuePrefix: false, confirmColorize: true, maxHeaderLength: Infinity, maxSubjectLength: Infinity, minSubjectLength: 0, scopeOverrides: undefined, defaultBody: '', defaultIssues: '', defaultScope: '', defaultSubject: '', } }
🔗 Reproduction link / repo:
No response