合并后对齐钩子计数:master 已 18 个,并补记 stages 的真实来源
master 比本分支基线多一个 test-cppcheck 钩子,故"定义数 / CI 报告数"由 17/16 变为 18/17(实测本地跑 --all-files 得 17 条:passed=16 failed=1,那 1 个 failed 是本机 .map 陈旧导致的 mem-numbers,与门禁逻辑无关)。 同时更正一处机制性误述:stages:[commit-msg] 并不在项目配置里,它写在 gitlint 上游的 .pre-commit-hooks.yaml(本机可查证 ~\.cache\pre-commit\repo*\),所以在 .pre-commit-config.yaml 里 grep stages 一无所获、极易误判成"没有限制"。 受影响四处:AGENTS.md、ci.yml 头注释、测试开发标准流程 §9.1、CI配置指南 §6 与 变更记录,另 ci_local.py 文档串。
This commit is contained in:
@@ -57,9 +57,10 @@
|
||||
# 且"显式设置就必须有效、不静默回退"的语义不变。
|
||||
#
|
||||
# 🔴 gitlint 属 commit-msg stage,`--all-files` **永远跑不到它**(2026-10-11 审计):
|
||||
# `.pre-commit-config.yaml` 定义 17 个钩子,CI 只报 16 个(`passed=15 skipped=1`)——
|
||||
# 缺的正是 gitlint:其钩子声明 `stages: [commit-msg]`,而 `pre-commit run --all-files`
|
||||
# 只跑 pre-commit stage。即 AGENTS.md 的"单行中文标题 <100 字符"门禁**本地有、CI 无**,
|
||||
# `.pre-commit-config.yaml` 定义 18 个钩子,CI 只报 17 个(`passed=16 skipped=1`)——
|
||||
# 缺的正是 gitlint:`stages: [commit-msg]` 写在 **gitlint 上游的 .pre-commit-hooks.yaml**
|
||||
# 里(项目配置里 grep 不到这一行),而 `pre-commit run --all-files` 只跑 pre-commit stage。
|
||||
# 即 AGENTS.md 的"单行中文标题 ≤100 字符"门禁**本地有、CI 无**,
|
||||
# 且表现为"全绿"而非失败,所以一直没人发现。现由 `scripts/ci_gitlint_range.ps1`
|
||||
# 逐条校验本次 push/PR 引入的提交(消息文件必须写在**仓库内**且 **UTF-8 无 BOM**:
|
||||
# 跨盘符会被 pre-commit 拒绝 `path is on mount 'C:', start on mount 'D:'`,
|
||||
|
||||
Reference in New Issue
Block a user