Commit e253e3f
committed
github: scripts: fix commit prefix extraction capture in linter
Update commit prefix regex handling in `.github/scripts/commit_prefix_check.py`
so subject prefix extraction returns only the prefix token (e.g. `build:`)
instead of including trailing content.
Changes:
- make `PREFIX_RE` capture just the prefix in group 1:
- from: `^[a-z0-9_]+:\s+\S`
- to: `^([a-z0-9_]+:)\s+\S`
- update subject prefix extraction to use `match.group(1)`
Why:
- previous extraction used `.group()` and could include extra matched text,
causing incorrect prefix comparisons during validation.
Notes:
- `detect_bad_squash()` uses `PREFIX_RE.match(...)` only as a boolean;
behavior remains unchanged there.
Signed-off-by: Eduardo Silva <[email protected]>1 parent 18b95a9 commit e253e3f
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
0 commit comments