Zhengqbbb / cz-git

cz-git | czg 🛠️ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.05k stars 39 forks source link

[Bug report] #137

Closed huizhang001 closed 1 year ago

huizhang001 commented 1 year ago

✅ Checklist

📄 System Info

MAC
iterm2
node:v18.5.0
czg@1.3.9

🔎 Description

您好:

image

并不生效!!!

我项目的配置: image

实际效果: image

我预期不选择直接: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

Zhengqbbb commented 1 year ago

Please update latest version v1.7.0 and test

npm install -g czg@latest
# or
npm install -D czg@latest
CleanShot 2023-07-11 at 18 02 11@2x
huizhang001 commented 1 year ago

我是用在go项目里的,用brew最方便吧,brew的最新版本是1.3.9

Zhengqbbb commented 1 year ago
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: '',
  }
  }
CleanShot 2023-07-11 at 18 32 44@2x
huizhang001 commented 1 year ago

thank you!!!!!, 切换了下brew的源,install下来的是最新包了。。。。