-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbak.commitlint.config.js.bak
140 lines (139 loc) · 4.57 KB
/
bak.commitlint.config.js.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// @ts-check
/** @type {import("@commitlint/types").UserConfig} */
module.exports = {
parserPreset: 'conventional-changelog-conventionalcommits',
ignores: [commit => commit.includes('init')],
// 继承的规则
extends: ['@commitlint/config-conventional'],
// 定义规则类型
rules: {
// body 开头空行
'body-leading-blank': [2, 'always'],
// footer 开头空行
'footer-leading-blank': [1, 'always'],
// header 最大内容长度
'header-max-length': [2, 'always', 108],
// subject 是否允许为空
'subject-empty': [2, 'never'],
// type 是否允许空
'type-empty': [2, 'never'],
// type 类型定义,表示 git 提交的 type 必须在以下类型范围内
'type-enum': [
2,
'always',
[
'feat', // 新增功能
'fix', // 修复 bug
'docs', // 文档变更
'style', // 代码格式(不影响功能,例如空格、分号等格式修正)
'refactor', // 代码重构(不包括 bug 修复、功能新增)
'perf', // 性能优化
'test', // 添加、修改测试用例
'build', // 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等
'ci', // 修改 CI 配置、脚本
'chore', // 对构建过程或辅助工具和库的更改(不影响源文件、测试用例
'revert', // 回滚 commit
],
],
},
prompt: {
settings: {},
messages: {
skip: '(可选)',
max: '(最多 %d 个字符)',
min: '(至少 %d 个字符)',
emptyWarning: '不能为空!',
upperLimitWarning: '超过限制!',
lowerLimitWarning: '低于限制!',
},
questions: {
type: {
description: '请确保你的提交遵循提交规范!\n选择你要提交的类型',
enum: {
feat: {
description: '✨ 新增产品功能',
title: 'Features',
emoji: '✨',
},
fix: {
description: '🐛 修复 bug',
title: 'Bug Fixes',
emoji: '🐛',
},
docs: {
description: '📝 文档的变更',
title: 'Documentation',
emoji: '📝',
},
style: {
description: '💄 代码格式化(不影响功能,例如空格、分号等格式修正)',
title: 'Styles',
emoji: '💄',
},
refactor: {
description: '📦 代码重构(不包括 bug 修复、功能新增)',
title: 'Code Refactoring',
emoji: '📦',
},
perf: {
description: '🚀 性能优化',
title: 'Performance Improvements',
emoji: '🚀',
},
test: {
description: '🚨 添加、修改测试用例',
title: 'Tests',
emoji: '🚨',
},
build: {
description: '👷 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)',
title: 'Builds',
emoji: '👷',
},
ci: {
description: '⚙️ 修改 CI 配置、脚本',
title: 'Continuous Integrations',
emoji: '⚙️',
},
chore: {
description: '♻️ 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)',
title: 'Chores',
emoji: '♻️',
},
revert: {
description: '⏪ 回滚 commit',
title: 'Reverts',
emoji: '⏪',
},
},
},
scope: {
description: '更改的范围(scope)(例如:组件或者文件名)',
},
subject: {
description: '填写简短精炼的变更描述',
},
body: {
description: '填写更加详细的变更描述',
},
isBreaking: {
description: '是否有任何重大变更?',
},
breakingBody: {
description: '重大变更(BREAKING CHANGE)提交需要正文,请输入提交本身的较长描述',
},
breaking: {
description: '描述重大变更(BREAKING CHANGE)',
},
isIssueAffected: {
description: '此更改是否影响任何未决问题(issues)?',
},
issuesBody: {
description: '如果问题(issues)已关闭,则提交需要正文。请输入提交本身的较长描述',
},
issues: {
description: '添加问题(issues)参考(例如:"fix #123","re #123")',
},
},
},
}