From 7f634e509dafdadc7559dbb387531143181fa3fc Mon Sep 17 00:00:00 2001 From: API Changelog Bot Date: Sun, 6 Sep 2026 20:33:05 +0800 Subject: [PATCH] =?UTF-8?q?gate:=20=E5=8D=A0=E4=BD=8D=E7=AC=A6=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=BF=BD=E7=95=A5=E4=BB=A3=E7=A0=81=E5=9B=B4=E6=A0=8F?= =?UTF-8?q?=E4=B8=8E=E5=8F=8D=E5=BC=95=E5=8F=B7=E5=86=85=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E2=80=94=E2=80=94=E6=8E=A5=E5=8F=A3=E6=9E=9A=E4=B8=BE=E5=80=BC?= =?UTF-8?q?=E6=9C=AC=E8=BA=AB=E5=8F=AF=E8=83=BD=E5=8F=AB=20TODO=EF=BC=88?= =?UTF-8?q?=E5=9B=A2=E6=9C=9F=E8=8A=AF=E7=89=87=E8=81=9A=E5=90=88=E6=80=81?= =?UTF-8?q?=EF=BC=8C#7204=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01N7Xpgcv9nncadAXQtWhg4P --- scripts/validate-changelog-frontmatter.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/validate-changelog-frontmatter.mjs b/scripts/validate-changelog-frontmatter.mjs index 54bf11cc..5f2ebac8 100644 --- a/scripts/validate-changelog-frontmatter.mjs +++ b/scripts/validate-changelog-frontmatter.mjs @@ -411,7 +411,9 @@ export function validateV2Document(file, text, { requireV2 = false } = {}) { errors.push(ruleError('E_TYPE_MISMATCH', file, `change_type=${metadata.change_type} 与文件名=${filenameType} 不一致`)); } // 单花括号是 REST 路径参数惯例({orderId}),只拦真正的模板残留:双花括号、TODO、待补充 - if (/\{\{[^{}\n]+\}\}|\bTODO\b|待补充/i.test(body)) { + // 代码围栏与反引号内文本不参与占位符检测:接口枚举值本身可能就叫 TODO(团期芯片聚合态 TODO/DOING/DONE,#7204),契约必须能原样写枚举值。 + const proseBody = body.replace(/```[\s\S]*?```/g, '').replace(/`[^`\n]*`/g, ''); + if (/\{\{[^{}\n]+\}\}|\bTODO\b|待补充/i.test(proseBody)) { errors.push(ruleError('E_PLACEHOLDER', file, '正文仍有 TODO、待补充或模板占位符')); } // 接口类条目必须逐项遵循根模板,保证前端不依赖 Swagger 或口头补充也能联调。