W11可运行与验证级别: 核心权重: 2修复方式: 支持自动修复
W11: feat/fix 提交配套测试变更(test-required 门禁)
为什么设立这条规则(一手实证依据)
生产 CI 审计表明,要求 feat/fix 类型的 PR 同时包含测试改动(或明确说明豁免原因)能有效拦住 AI 漏写测试的功能提交。
修复建议添加
.github/workflows/test-required.yml 门禁或运行 agentlint fix W11。多项目真实生产仓库审计记录 (2026)
反例(会触发 W11 告警)
# Anti-pattern triggering W11 (feat/fix commits paired with test commits (test-required gate)) # Feature and bug-fix PRs merge without any test changes or verification check.
推荐写法(通过 W11 检查)
# Compliant harness passing W11 (feat/fix commits paired with test commits (test-required gate)) # Blocking CI workflow ensures feat/fix PRs include matching tests unless explicitly justified.
本地 CLI 或浏览器一键验证
npm install -g agentlint-ai && agentlint check --check W11