1.5 KiB
FAIL
tests/scripts/comments.py:68 — 本轮新增的 TS/CSS 跨行检查把字符串里的 /* 当作注释起点,拒绝合法源码。复现:在独立临时根目录的 site/src/probe.ts 写入单行 const glob = "/*.css";,运行 python3 tests/scripts/comments.py <临时根目录>,退出 1,报 comment runs past one line;改为 site/src/probe.css,写入单行 a::after { content: "/*"; },同样退出 1。两份源码均无注释;现有 comments-rules.sh 仍通过,缺少字符串回归用例。修复方向:在识别块注释起点时正确跳过字符串,并为 TS/CSS 的字符串内容补通过用例,同时保留第 4 轮真实跨行注释的失败用例。
tests/scripts/comments.py:37 — TS/CSS 的单行注释正则要求注释位于整行开头,漏检代码尾部的超长注释(CSS 同文件:38)。复现:在独立临时根目录的 site/src/probe.ts 写入 const a = 1; // One two three four five six seven eight nine ten eleven.,运行 python3 tests/scripts/comments.py <临时根目录>,退出 0 并声称每条注释均在十词以内;改为 site/src/probe.css,写入 a { color: red; } /* One two three four five six seven eight nine ten eleven. */,同样退出 0。两条注释各有十一词,违反 agents.md 与 site/TASKS.md;现有回归测试只检查独占整行的超长 TS/CSS 注释。修复方向:提取代码尾部的实际注释并核对词数,补上两种后缀的失败回归用例。