Uh oh!
There was an error while loading. Please reload this page.
docs(ci): 去掉 check-lint-coverage.mjs 头注里的 object-ui 规则点数,并把守卫扩到该文件 (#3279) - #3784
Merged
Merged
Conversation
…3279) `scripts/check-lint-coverage.mjs` 的文件头 docblock 说 `eslint.config.js` 把 **three** 条 `object-ui/*` 规则设成了 `error`,并在括号里手工列举来源(ADR-0054 Phase 5、#2879、objectql.ts ratchet)。这是 #3261 从 `.github/workflows/lint.yml` 里删掉的那句话的逐字副本,连漏掉的规则都是同一条:配置里设成 `error` 的 `object-ui/*` 规则实际有四条 —— L59 no-synthetic-event-trigger、L65 no-try-catch-around-hook、L98 no-dynamic-import-in-test-hook、L111 no-inline-spec-config,漏的是第三条。#3261 只改了 workflow,这份副本原样留着, 所以它今天就是错的,而不是"将来会错"。 ## 头注改法 按 #3261 / PR #3273 在 `lint.yml` 里确立的写法去数字化:不点数、不在括号里列 来源,改成「every `object-ui/*` rule that `eslint.config.js` sets to `error`」 这种永真表述。这段话本身正确的主张一字未动 —— 没有 `lint` script 的包不是干净 而是没被 lint 过,ratchet 在那里一文不值。同时按 `lint.yml` 的同构做法补一段, 说明为什么这里刻意不点数也不列举,以及唯一诚实的清单是 `eslint.config.js` 本身(每条规则自己的 ADR/issue 就写在它旁边的注释里)。 ## 守卫扩面 `scripts/__tests__/lint-workflow.test.ts`(#3273 新增)的两条断言 —— 不得点数、 不得按名列举 —— 此前只扫 `lint.yml`,看不见这第二份副本,所以它是被人顺手读到 (#3274)而不是被门禁挡下来的。现在把扫描面参数化成一个 prose surface 列表, `lint.yml` 与 `check-lint-coverage.mjs` 各出一项,判定逻辑(点数正则、规则名 比对)原样复用,只是按 surface 取注释: - 注释块提取按标记参数化 —— YAML 的 `#` 行首标记与 docblock 的星号行首标记共用 一个 `unwrap(block, marker)`,`\s+` 折行还原照旧,因为 #3261 那句话正是断在 "sets three" 与 "`object-ui/*` rules" 之间的。 - 点数正则只读各文件的解释性注释,不读整个文件。对这个脚本这条限定是必需的而 非洁癖:它的 `Known gaps` 注释合法地在数**包**(「the last two …, 14 errors」), 整文件扫描会把它当成规则条数报出来。 - 规则名比对仍读整个文件 —— 规则名出现在这两个文件的任何位置,都是 `eslint.config.js` 的第二份拷贝。 原来那条「eslint.config.js 确实还有 `object-ui/*` 规则设成 error」的前提断言 现在被两份注释共用,单独提成一个 describe;`lint.yml` 专属的两条触发器断言 (仍跑 pull_request、ignore 列表不吞 .ts/.tsx)留在原处不动。 ## 验证 - `grep -n 'object-ui/' eslint.config.js` 确认四条 error 规则现状。 - 仓库根 `pnpm vitest run scripts/__tests__/lint-workflow.test.ts`:7 passed (扩面前 5:2 条守卫 × 2 个 surface + 1 前提 + 2 触发器)。 - `pnpm type-check:scripts` 干净通过。 - `node scripts/check-control-bytes.mjs` OK;改动文件另做一次 `grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]'` 自扫,零控制字节。 - 变异自证:把原来那句点数写回 mjs 头注,`check-lint-coverage.mjs` 的 never-hand-counts 一条变红(counted 报出 "three `object-ui"),其余六条仍绿; 变异不入 commit。 不带 changeset:`scripts/**` 不在 `check-changeset-presence.mjs` 的守卫面 (`<pkg>/src/**`,取自 `.changeset/config.json` 的 fixed 组)之内,且先例 PR #3273 / #3278 改的正是这两个文件、均未带 changeset。
The latest updates on your projects. Learn more about Vercel for GitHub. |
yinlianghui
commented
Aug 8, 2026
CollaboratorAuthor
✅ 验收通过(objectui 分片 PM,session_01GTRjn8xBqp75dk7kFupVRt)—— undraft + auto-merge。 git 实物核验(
衍生:dev 立的 #3782(ci-cd-pipeline.md 同一事实第四份手抄,含规则名)为 Generated by Claude Code |
yinlianghui
marked this pull request as ready for review
August 8, 2026 15:29
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#3279
前提复核(先于实施)
issue 的前提在
origin/main上原样成立,两处读数都显式取自origin/main:注释说 three,配置里是四条,漏的正是
no-dynamic-import-in-test-hook—— 与 #3261 当初漏掉的是同一条。这不是「将来会错」,是今天就错。改动一:头注去数字化
按 #3261 / PR #3273 在
lint.yml里确立的写法改写:不点数、不在括号里列来源,改成永真表述。这段话本身正确的主张一字未动 —— 没有lintscript 的包不是干净而是没被 lint 过,ratchet 在那里一文不值。并按
lint.yml的同构做法补一段,写下为什么这里刻意不点数也不列举、以及唯一诚实的清单是eslint.config.js本身(每条规则自己的 ADR/issue 就写在它旁边的注释里)。lint.yml的对应措辞是「eslint.config.jsis the single list of those rules, and this comment deliberately neither counts them nor names them」,本 PR 的措辞与之同构。改动二:守卫扫描面参数化(issue 正文授权,按判断做了)
scripts/__tests__/lint-workflow.test.ts(#3273 新增)的两条断言 —— 不得点数、不得按名列举 —— 此前只扫lint.yml,看不见这第二份副本;所以它是被人顺手读到(#3274)而不是被门禁挡下来的。现在扫描面变成一个 prose surface 列表,lint.yml与check-lint-coverage.mjs各出一项,判定逻辑原样复用(点数正则、规则名比对、求值后 flat config 的读法都没动),只按 surface 取注释:#行首标记与 docblock 的星号行首标记共用一个unwrap(block, marker),折行还原照旧 —— lint.yml 的头部注释说「三条 object-ui/* 规则设成 error」,实际已经是四条 #3261 那句话正是断在 "sets three" 与 "object-ui/*rules" 之间,任何跨行匹配都必须先还原折行。Known gaps注释合法地在数包(「the last two …, 14 errors」),整文件扫描会把它当成规则条数误报出来。这一点写进了测试头注,免得下一个人以为是漏扫。eslint.config.js的第二份拷贝。原来那条「
eslint.config.js确实还有object-ui/*规则设成error」的前提断言现在被两份注释共用,单独提成一个 describe;lint.yml专属的两条触发器断言(仍跑pull_request、ignore 列表不吞.ts/.tsx)留在原处,逻辑未动。验证
守卫测试(从仓库根跑,invocation guard 拒绝 package-cwd):
7 条 = 2 条守卫 × 2 个 surface + 1 条共用前提 + 2 条
lint.yml触发器(扩面前为 5 条)。变异自证(方向在跑之前就定了:应当变红,且只有新增的那一条红)。把
origin/main的点数句写回 mjs 头注:命中项正是
"three `object-ui";规则名那条仍绿 —— 原句列举的是 ADR/issue 而非规则名,所以只有点数这一条该红,与预期一致。变异已git checkout --还原,还原后重跑 7 passed,不入 commit。其余门禁:
控制字节除了跑仓库门禁,另对两个改动文件单独自扫了一次(门禁的扫描面之外仍可能藏字节)。
不带 changeset 的依据
scripts/**不在scripts/check-changeset-presence.mjs的守卫面内 —— 那道门禁只看.changeset/config.json的fixed组里各包的src目录。先例也一致:PR #3273(lint.yml+ 本测试文件)与 PR #3278(lint.yml+ 本脚本)改的正是同一批文件,均未带 changeset。这次改的是内部脚本的注释与一个仓库根测试,没有发布产物变化。顺带记录(不在本 PR 内)
content/docs/guide/ci-cd-pipeline.md:201-202括号里还有同一事实的第四份手抄清单(而且点了一条规则名)。它今天恰好是完整的,但没有任何门禁钉它,且把它加进本 PR 的 surface 列表会当场变红 —— 需要先做一个文档措辞取舍。已按 Prime Directive #10 单独记为 #3782(finding标签,未指派),不夹带进本 PR。Generated by Claude Code