🐛 fix(ci): allow kebab-case commit scopes
The scope regex only accepted [a-z0-9_], rejecting hyphenated scopes like tsl-syntax that dominate the history (12x vs 4x underscore form). Align both linter copies and the spec doc to accept lower-kebab-case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -78,7 +78,7 @@ def _validate_subject_line(
|
||||
m = re.match(
|
||||
r"^(?:(?P<emoji>:[a-z0-9_+-]+:)\s+)?"
|
||||
r"(?P<type>[a-z]+)"
|
||||
r"(?P<scope>\([a-z0-9_]+\))?"
|
||||
r"(?P<scope>\([a-z0-9_-]+\))?"
|
||||
r":\s+(?P<text>.+)$",
|
||||
subject,
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ footer
|
||||
- `emoji`:可选,位于首行行首;若使用,必须与 `type`
|
||||
一一对应(见 4)。为保持一致性,建议默认使用 emoji;若不使用则省略即可。
|
||||
- `type`:变更类型,必须从 4 的对应表中选取。
|
||||
- `scope`:可选,业务域/组件名(`lower_snake_case`),用于辅助定位影响范围。
|
||||
- `scope`:可选,业务域/组件名(`lower-kebab-case` 或 `lower_snake_case`),用于辅助定位影响范围。
|
||||
- `subject`:一句话概述,使用祈使句/现在时,首字母小写,不加句号。
|
||||
- `body`:可选,说明动机、关键实现、影响面;每行建议 ≤ 72 字符。
|
||||
- `footer`:可选,关联任务/缺陷号,或 `BREAKING CHANGE:` 说明不兼容变更。
|
||||
|
||||
@@ -78,7 +78,7 @@ def _validate_subject_line(
|
||||
m = re.match(
|
||||
r"^(?:(?P<emoji>:[a-z0-9_+-]+:)\s+)?"
|
||||
r"(?P<type>[a-z]+)"
|
||||
r"(?P<scope>\([a-z0-9_]+\))?"
|
||||
r"(?P<scope>\([a-z0-9_-]+\))?"
|
||||
r":\s+(?P<text>.+)$",
|
||||
subject,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user