.commitlintrc.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // .commitlintrc.js
  2. /** @type {import('cz-git').UserConfig} */
  3. module.exports = {
  4. rules: {
  5. // @see: https://commitlint.js.org/#/reference-rules
  6. },
  7. prompt: {
  8. alias: { fd: 'docs: fix typos' },
  9. messages: {
  10. type: '选择你要提交的类型 :',
  11. scope: '选择一个提交范围(可选):',
  12. customScope: '请输入自定义的提交范围 :',
  13. subject: '填写简短精炼的变更描述 :\n',
  14. body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
  15. breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
  16. footerPrefixsSelect: '选择关联issue前缀(可选):',
  17. customFooterPrefixs: '输入自定义issue前缀 :',
  18. footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
  19. confirmCommit: '是否提交或修改commit ?'
  20. },
  21. types: [
  22. { value: 'feat', name: 'feat: ✨ 新增功能 | A new feature', emoji: ':sparkles:' },
  23. { value: 'fix', name: 'fix: 🐛 修复缺陷 | A bug fix', emoji: ':bug:' },
  24. { value: 'docs', name: 'docs: 📝 文档更新 | Documentation only changes', emoji: ':memo:' },
  25. { value: 'style', name: 'style: 💄 代码格式 | Changes that do not affect the meaning of the code', emoji: ':lipstick:' },
  26. { value: 'refactor', name: 'refactor: ♻️ 代码重构 | A code change that neither fixes a bug nor adds a feature', emoji: ':recycle:' },
  27. { value: 'perf', name: 'perf: ⚡️ 性能提升 | A code change that improves performance', emoji: ':zap:' },
  28. { value: 'test', name: 'test: ✅ 测试相关 | Adding missing tests or correcting existing tests', emoji: ':white_check_mark:' },
  29. { value: 'build', name: 'build: 📦️ 构建相关 | Changes that affect the build system or external dependencies', emoji: ':package:' },
  30. { value: 'ci', name: 'ci: 🎡 持续集成 | Changes to our CI configuration files and scripts', emoji: ':ferris_wheel:' },
  31. { value: 'revert', name: 'revert: ⏪️ 回退代码 | Revert to a commit', emoji: ':rewind:' },
  32. { value: 'chore', name: 'chore: 🔨 其他修改 | Other changes that do not modify src or test files', emoji: ':hammer:' },
  33. ],
  34. useEmoji: false,
  35. emojiAlign: 'center',
  36. themeColorCode: '',
  37. scopes: [],
  38. allowCustomScopes: true,
  39. allowEmptyScopes: true,
  40. customScopesAlign: 'bottom',
  41. customScopesAlias: 'custom',
  42. emptyScopesAlias: 'empty',
  43. upperCaseSubject: false,
  44. markBreakingChangeMode: true,
  45. allowBreakingChanges: ['feat', 'fix'],
  46. breaklineNumber: 100,
  47. breaklineChar: '|',
  48. skipQuestions: [],
  49. issuePrefixs: [
  50. // 如果使用 gitee 作为开发管理
  51. { value: 'link', name: 'link: 链接 ISSUES 进行中' },
  52. { value: 'closed', name: 'closed: 标记 ISSUES 已完成' }
  53. ],
  54. customIssuePrefixsAlign: 'top',
  55. emptyIssuePrefixsAlias: 'skip',
  56. customIssuePrefixsAlias: 'custom',
  57. allowCustomIssuePrefixs: true,
  58. allowEmptyIssuePrefixs: true,
  59. confirmColorize: true,
  60. maxHeaderLength: Infinity,
  61. maxSubjectLength: Infinity,
  62. minSubjectLength: 0,
  63. scopeOverrides: undefined,
  64. defaultBody: '',
  65. defaultIssues: '',
  66. defaultScope: '',
  67. defaultSubject: ''
  68. }
  69. }