# @h3/commitlint-config-standard
维护人:东润(chenwr@authine.com)、木木(linqh@authine.com)
规则构成
commitlint rules: commitlint允许配置的选项大全
规则继承
@h3/commitlint-config-standard
是在继承了@commitlint/config-conventional
基础上定制@h3yun/commitlint-config
继承了@h3/commitlint-config-standard
- 规则
- body-leading-blank
- body-max-length
- body-max-line-length
- body-min-length
- footer-leading-blank
- footer-max-length
- footer-max-line-length
- footer-min-length
- header-case
- header-full-stop
- header-max-length
- header-min-length
- references-empty
- scope-enum
- scope-case
- scope-empty
- scope-max-length
- scope-min-length
- subject-case
- subject-empty
- subject-full-stop
- subject-max-length
- subject-min-length
- type-enum
- type-case
- type-empty
- type-max-length
- type-min-length
- signed-off-by
# 规则
# body-leading-blank
- condition:
body
是否以空行开始 - rule:
always
奥哲内部规则
默认
# body-max-length
- condition:
body
最大长度 - rule:
always
- value
Infinity
1
奥哲内部规则
默认
# body-max-line-length
- condition:
body
最大行数 - rule:
always
- value
Infinity
1
奥哲内部规则
默认
# body-min-length
- condition:
body
最小长度 - rule:
always
- value
0
1
奥哲内部规则
默认
# footer-leading-blank
- condition:
footer
是否以空行开始 - rule:
always
奥哲内部规则
默认
# footer-max-length
- condition:
footer
最大长度 - rule:
always
- value
Infinity
1
奥哲内部规则
默认
# footer-max-line-length
- condition:
footer
最大行数 - rule:
always
- value
Infinity
1
奥哲内部规则
默认
# footer-min-length
- condition:
footer
最小长度 - rule:
always
- value
0
1
奥哲内部规则
默认
# header-case
- condition:
header
文本符合以下命名规范 - rule:
always
'lowerCase'
1
- possible values
[
'lower-case', // default
'upper-case', // UPPERCASE
'camel-case', // camelCase
'kebab-case', // kebab-case
'pascal-case', // PascalCase
'sentence-case', // Sentence case
'snake-case', // snake_case
'start-case', // Start Case
]
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
奥哲内部规则
默认
# header-full-stop
condition:
header
以什么文本为结尾rule:
never
value
'.'
1
奥哲内部规则
默认
# header-max-length
condition:
header
最大长度rule:
always
value
72
1
奥哲内部规则
{
...
'header-max-length': [2, 'always', 100],
...
}
1
2
3
4
5
2
3
4
5
# header-min-length
- condition:
header
最小长度 - rule:
always
- value
0
1
奥哲内部规则
默认
# references-empty
- condition:
references
至少一个关联引用 例如:#233 - rule:
never
奥哲内部规则
@h3/commitlint-config-standard
默认@h3yun/commitlint-config
{
...
'references-empty': [2, 'never'],
...
}
1
2
3
4
5
2
3
4
5
# scope-enum
- condition:
scope
只能是给定枚举 - rule:
always
- value
[]
1
奥哲内部规则
默认
# scope-case
- condition:
scope
文本符合以下命名规范 - rule:
always
'lowerCase'
1
- possible values
[
'lower-case', // default
'upper-case', // UPPERCASE
'camel-case', // camelCase
'kebab-case', // kebab-case
'pascal-case', // PascalCase
'sentence-case', // Sentence case
'snake-case', // snake_case
'start-case', // Start Case
]
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
奥哲内部规则
{
...
'scope-case': [2, 'always', [
'lower-case', // default
'upper-case', // UPPERCASE
'camel-case', // camelCase
'kebab-case', // kebab-case
'pascal-case', // PascalCase
'sentence-case', // Sentence case
'snake-case', // snake_case
'start-case', // Start Case
]],
...
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# scope-empty
- condition:
scope
只能为空 - rule:
never
奥哲内部规则
默认
# scope-max-length
- condition:
scope
最大长度 - rule:
always
- value
Infinity
1
奥哲内部规则
默认
# scope-min-length
- condition:
scope
最小长度 - rule:
always
- value
0
1
奥哲内部规则
默认
# subject-case
- condition:
subject
文本符合以下命名规范 - rule:
always
'lowerCase'
1
- possible values
[
'lower-case', // default
'upper-case', // UPPERCASE
'camel-case', // camelCase
'kebab-case', // kebab-case
'pascal-case', // PascalCase
'sentence-case', // Sentence case
'snake-case', // snake_case
'start-case', // Start Case
]
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
奥哲内部规则
{
...
'subject-case': [0],
...
}
1
2
3
4
5
2
3
4
5
# subject-empty
- condition:
subject
只能为空 - rule:
never
奥哲内部规则
默认
# subject-full-stop
- condition:
subject
以什么文本为结尾 - rule:
never
- value
'.'
1
奥哲内部规则
默认
# subject-max-length
- condition:
subject
最大长度 - rule:
always
- value
Infinity
1
奥哲内部规则
默认
# subject-min-length
- condition:
subject
最小长度 - rule:
always
- value
0
1
奥哲内部规则
默认
# type-enum
- condition:
type
只能是给定枚举 - rule:
always
- value
[
'feat',
'fix',
'docs',
'style',
'refactor',
'test',
'revert'
]
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
奥哲内部规则
{
...
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'improvement',
'perf',
'refactor',
'revert',
'style',
'test',
'WIP',
],
],
...
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# type-case
- description:
type
文本符合以下命名规范 - rule:
always
- value
'lower-case'
1
- possible values
[
'lower-case', // default
'upper-case', // UPPERCASE
'camel-case', // camelCase
'kebab-case', // kebab-case
'pascal-case', // PascalCase
'sentence-case', // Sentence case
'snake-case', // snake_case
'start-case', // Start Case
]
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
奥哲内部规则
{
...
'type-case': [2, 'always', [
'lower-case', // default
'upper-case', // UPPERCASE
]],
...
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# type-empty
- condition:
type
只能为空 - rule:
never
奥哲内部规则
默认
# type-max-length
- condition:
type
最大长度 - rule:
always
- value
Infinity
1
奥哲内部规则
默认
# type-min-length
- condition:
type
最小长度 - rule:
always
- value
0
1
奥哲内部规则
默认
# signed-off-by
- condition:
message
必须有值 - rule:
always
- value
'Signed-off-by:'
1
奥哲内部规则
默认