规则
¥Rules
body-case
条件:
body位于value的 case 中¥condition:
bodyis in casevalue规则:
always¥rule:
alwaysvalue
text'lower-case'可能的值
¥possible values
js[ "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 ];
body-empty
条件:
body为空¥condition:
bodyis empty规则:
never¥rule:
never
body-full-stop
条件:
body以value结尾¥condition:
bodyends withvalue规则:
never¥rule:
nevervalue
text'.'
body-leading-blank
条件:
body以空行开头¥condition:
bodybegins with blank line规则:
always¥rule:
always
body-max-length
条件:
body包含value个或更少个字符¥condition:
bodyhasvalueor less characters规则:
always¥rule:
alwaysvalue
textInfinity
body-max-line-length
条件:
body行的字符数不超过value,或者包含 URL¥condition:
bodylines havevalueor less characters, or contain a URL规则:
always¥rule:
alwaysvalue
textInfinity
body-min-length
条件:
body包含value个或更多个字符¥condition:
bodyhasvalueor more characters规则:
always¥rule:
alwaysvalue
text0
breaking-change-exclamation-mark
条件:如果
header中:标记前有感叹号,且footer中的某一行匹配正则表达式^BREAKING[ -]CHANGE:,则此配置失败。¥condition: Either both or neither
headerhas an exclamation mark before the:marker and a line infootermatches the regular expression^BREAKING[ -]CHANGE:规则:
always¥rule:
always
NOTE
此规则强制要求在提交头中使用 !,在提交尾中使用 BREAKING CHANGE 来标记重大更改。此配置的行为类似于异或 (XNOR) 运算:
¥This rule enforces that breaking changes are marked by both a ! in the header and BREAKING CHANGE in the footer. The behavior is that of an XNOR operation:
如果满足两个条件之一或两个条件都不满足,则此配置通过。
¥It passes when either both are present or both are not.
如果满足其中一个条件而另一个条件不满足,则此配置失败。
¥It fails when one is present and the other is not.
footer-empty
条件:
footer为空¥condition:
footeris empty规则:
never¥rule:
never
footer-leading-blank
条件:
footer以空行开头¥condition:
footerbegins with blank line规则:
always¥rule:
always
footer-max-length
条件:
footer包含value个或更少个字符¥condition:
footerhasvalueor less characters规则:
always¥rule:
alwaysvalue
textInfinity
footer-max-line-length
条件:
footer行的字符数不超过value¥condition:
footerlines havevalueor less characters规则:
always¥rule:
alwaysvalue
textInfinity
footer-min-length
条件:
footer包含value个或更多个字符¥condition:
footerhasvalueor more characters规则:
always¥rule:
alwaysvalue
text0
header-case
条件:
header位于value的 case 中¥condition:
headeris in casevalue规则:
always¥rule:
alwaysvalue
text'lower-case'可能的值
¥possible values
js[ "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 ];
header-full-stop
条件:
header以value结尾¥condition:
headerends withvalue规则:
never¥rule:
nevervalue
text'.'
header-max-length
条件:
header包含value个或更少个字符¥condition:
headerhasvalueor less characters规则:
always¥rule:
alwaysvalue
text72
header-min-length
条件:
header包含value个或更多个字符¥condition:
headerhasvalueor more characters规则:
always¥rule:
alwaysvalue
text0
header-trim
条件:
header行的开头和结尾不得有空格¥condition:
headermust not have initial or trailing whitespaces规则:
always¥rule:
always
references-empty
条件:
references至少包含一个条目¥condition:
referenceshas at least one entry规则:
never¥rule:
never
scope-case
条件:
scope位于value的 case 中¥condition:
scopeis in casevalue规则:
always¥rule:
alwaysvalue
text'lower-case'可能的值
¥possible values
js[ "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 ];
scope-empty
条件:
scope为空¥condition:
scopeis empty规则:
never¥rule:
never
scope-enum
条件:
scope位于值中¥condition:
scopeis found in value规则:
always¥rule:
alwaysvalue
text[]
NOTE
如果消息中未提供作用域或值 > 为空数组,则此规则始终有效。
¥This rule always passes if no scopes are provided in the message or the value > is an empty array.
设置为
always时,所有消息范围都必须在值中找到。¥When set to
always, all message scopes must be found in the value.设置为
never时,任何消息范围都无法在值中找到。¥When set to
never, none of the message scopes can be found in the value.
scope-max-length
条件:
scope包含value个或更少个字符¥condition:
scopehasvalueor less characters规则:
always¥rule:
alwaysvalue
textInfinity
scope-min-length
条件:
scope包含value个或更多个字符¥condition:
scopehasvalueor more characters规则:
always¥rule:
alwaysvalue
text0
signed-off-by
条件:
message包含value¥condition:
messagehasvalue规则:
always¥rule:
alwaysvalue
text'Signed-off-by:'
subject-case
条件:
subject位于value的 case 中¥condition:
subjectis in casevalue规则:
always¥rule:
alwaysvalue
js["sentence-case", "start-case", "pascal-case", "upper-case"];可能的值
¥possible values
js[ "lower-case", // lower case "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 ];
subject-empty
条件:
subject为空¥condition:
subjectis empty规则:
never¥rule:
never
subject-exclamation-mark
条件:
subject在:标记前有一个感叹号¥condition:
subjecthas exclamation before the:marker规则:
never¥rule:
never
subject-full-stop
条件:
subject以value结尾¥condition:
subjectends withvalue规则:
never¥rule:
nevervalue
text'.'
subject-max-length
条件:
subject包含value个或更少个字符¥condition:
subjecthasvalueor less characters规则:
always¥rule:
alwaysvalue
textInfinity
subject-min-length
条件:
subject包含value个或更多个字符¥condition:
subjecthasvalueor more characters规则:
always¥rule:
alwaysvalue
text0
trailer-exists
条件:
message包含尾随value¥condition:
messagehas trailervalue规则:
always¥rule:
alwaysvalue
text'Signed-off-by:'
type-case
描述:
type位于value的 case 中¥description:
typeis in casevalue规则:
always¥rule:
alwaysvalue
text'lower-case'可能的值
¥possible values
js[ "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 ];
type-empty
条件:
type为空¥condition:
typeis empty规则:
never¥rule:
never
type-enum
条件:
type位于值中¥condition:
typeis found in value规则:
always¥rule:
alwaysvalue
js[ "build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", ];
type-max-length
条件:
type包含value个或更少个字符¥condition:
typehasvalueor less characters规则:
always¥rule:
alwaysvalue
textInfinity
type-min-length
条件:
type包含value个或更多个字符¥condition:
typehasvalueor more characters规则:
always¥rule:
alwaysvalue
text0