Skip to content

Commit 4ceb5fc

Browse files
committed
build: 追加 commitlint.config.js
1 parent abaeb8d commit 4ceb5fc

2 files changed

Lines changed: 67 additions & 1 deletion

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ node_modules/
66
__pycache__/
77
.history/
88
changelog.config.js
9-
commitlint.config.js
109
tempCodeRunnerFile.*

commitlint.config.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
const { defineConfig } = require('cz-git')
2+
3+
module.exports = defineConfig({
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+
footerPrefixesSelect: '选择此变更所关联的ISSUES类型(可选):',
17+
customFooterPrefix: '输入ISSUES前缀:',
18+
footer: '列出此变更相关的ISSUES。例如:#31, #34:\n',
19+
generatingByAI: '正在生成你的AI提交标题...',
20+
generatedSelectByAI: '选择AI生成的合适标题:',
21+
confirmCommit: '你确定要提交上述变更吗?'
22+
},
23+
types: [
24+
{ value: 'feat', name: 'feat: ✨ 新功能', emoji: '✨' },
25+
{ value: 'fix', name: 'fix: 🐛 修复 bug', emoji: '🐛' },
26+
{ value: 'docs', name: 'docs: 📝 仅修改文档', emoji: '📝' },
27+
{ value: 'style', name: 'style: 💄 不影响代码意义的变动', emoji: '💄' },
28+
{ value: 'refactor', name: 'refactor: ♻️ 代码重构,既不修复bug也不新增功能', emoji: '♻️' },
29+
{ value: 'perf', name: 'perf: ⚡️ 提升性能的代码变动', emoji: '⚡️' },
30+
{ value: 'test', name: 'test: ✅ 添加或修正测试', emoji: ':✅' },
31+
{ value: 'build', name: 'build: 📦️ 影响构建系统或外部依赖的变动', emoji: '📦️' },
32+
{ value: 'ci', name: 'ci: 🎡 修改CI配置文件和脚本', emoji: '🎡' },
33+
{ value: 'chore', name: 'chore: 🔨 其他不修改源代码或测试文件的变动', emoji: '🔨' },
34+
{ value: 'revert', name: 'revert: ⏪️ 回滚之前的提交', emoji: '⏪️' }
35+
]
36+
,
37+
useEmoji: false,
38+
emojiAlign: 'center',
39+
useAI: false,
40+
aiNumber: 1,
41+
themeColorCode: '',
42+
scopes: [],
43+
allowCustomScopes: true,
44+
allowEmptyScopes: true,
45+
customScopesAlign: 'bottom',
46+
customScopesAlias: '自定义',
47+
emptyScopesAlias: '无',
48+
upperCaseSubject: false,
49+
markBreakingChangeMode: false,
50+
allowBreakingChanges: ['feat', 'fix'],
51+
breaklineNumber: 100,
52+
breaklineChar: '|',
53+
skipQuestions: [],
54+
issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been processed' }],
55+
customIssuePrefixAlign: 'top',
56+
emptyIssuePrefixAlias: '跳过',
57+
customIssuePrefixAlias: '自定义',
58+
allowCustomIssuePrefix: true,
59+
allowEmptyIssuePrefix: true,
60+
confirmColorize: true,
61+
scopeOverrides: undefined,
62+
defaultBody: '',
63+
defaultIssues: '',
64+
defaultScope: '',
65+
defaultSubject: ''
66+
}
67+
})

0 commit comments

Comments
 (0)