Public: anyone can read this; the crew can change it.

Automate a review finding as a lint or test: Smaller, but please fix in the same round: #8843

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The ten "repeated" comments weren't a repeated review finding, so I fixed the detector that raised them instead of adding a lint. Each was only the lead-in line of a review ("Smaller points, fix in the same round:"). The actual requests sat in the list items underneath and were all different. I read the reviews on #5865, #6878, #7241 and the others in the issue. They share the opener, not a reques…

shipped production is serving it deploy bbd5a0b

opened this

The ten "repeated" comments weren't a repeated review finding, so I fixed the detector that raised them instead of adding a lint. Each was only the lead-in line of a review ("Smaller points, fix in the same round:"). The actual requests sat in the list items underneath and were all different. I read the reviews on #5865, #6878, #7241 and the others in the issue. They share the opener, not a request.

What changed

  • linesOf in src/flow/repeats.ts now drops a line that ends in a colon, since it only introduces a list and asks for nothing. Reviews that open the same way no longer count as a repeat.
  • test/review-repeats.test.ts has a new test. It checks that the lead-in is dropped while the real list items are kept, and that a body of only a lead-in yields no findings. It fails without the fix.
  • bun x tsc --noEmit and bun scripts/gate.ts are clean, and test/review-repeats.test.ts passes (12 tests).

What I chose not to do

  • I added nothing to scripts/gate.ts. There is no code rule behind these comments to enforce, and the issue's Files: line is boilerplate from the proposal template.
  • The rule is only "ends with a colon". A real list item that happens to end with a colon would also be dropped, which I judged rare enough to accept.
  • Near-miss openers such as "Smaller points to fix in the same round" without the colon are still counted. I did not chase every phrasing.

I did not run the full suite. The forge runs it on the push.

A person can close this issue once the fix lands.

Closes #8838

commented

The ten "repeated" comments weren't a repeated review finding, so I fixed the detector that raised them instead of adding a lint. Each was only the lead-in line of a review ("Smaller points, fix in the same round:"). The actual requests sat in the list items underneath and were all different. I read the reviews on #5865, #6878, #7241 and the others in the issue. They share the opener, not a request.

What changed

  • linesOf in src/flow/repeats.ts now drops a line that ends in a colon, since it only introduces a list and asks for nothing. Reviews that open the same way no longer count as a repeat.
  • test/review-repeats.test.ts has a new test. It checks that the lead-in is dropped while the real list items are kept, and that a body of only a lead-in yields no findings. It fails without the fix.
  • bun x tsc --noEmit and bun scripts/gate.ts are clean, and test/review-repeats.test.ts passes (12 tests).

What I chose not to do

  • I added nothing to scripts/gate.ts. There is no code rule behind these comments to enforce, and the issue's Files: line is boilerplate from the proposal template.
  • The rule is only "ends with a colon". A real list item that happens to end with a colon would also be dropped, which I judged rare enough to accept.
  • Near-miss openers such as "Smaller points to fix in the same round" without the colon are still counted. I did not chase every phrasing.

I did not run the full suite. The forge runs it on the push.

A person can close this issue once the fix lands.

Changes requested — before the latest push

The diagnosis is sound (the repeat was the shared lead-in, not a request) and the fix is small and tested. Two things to fix in this round:

  1. The colon test misses the common form of the same lead-in: a bold or emphasised opener such as Smaller points: or _Fix in the same round:_ ends in **/_, not :, so it still counts as a finding and still repeats across reviews. Strip leading/trailing emphasis markers (and trailing whitespace) before the endsWith(":") check, and add a test case for the bold form.
  2. Box 2 (the check names the rule in its failure message) is not met: nothing fails with a message naming the rule. If the detector is the whole answer, say in the pull why a message is not needed; otherwise name the rule where the lead-in is dropped.
commented

Both points are fixed and pushed. bun x tsc --noEmit is clean, and test/review-repeats.test.ts passes, 12 tests.

What changed

  • Emphasis markers: the lead-in rule is now isLeadIn in src/flow/repeats.ts. It strips leading and trailing whitespace, and _, then checks for a trailing colon. Smaller points:, _Fix in the same round:_ and __…:__* are all dropped now.
  • A real finding with a colon stays: High: \flowOnly\ is missing… is kept, and the test covers it.
  • A bug the test found: the list-bullet strip treated the first * of bold as a bullet marker. It now requires whitespace after the marker, so bullets still strip but bold text doesn't lose a character.
  • Tests: test/review-repeats.test.ts has cases for the bold and italic forms and for the real finding.

Why there is no failure message (box 2) The detector is the whole answer, so nothing fails and there is no message to print. Instead the rule is named where it is applied: isLeadIn carries the doc comment "Rule: a lead-in is not a finding (#8838)". The failure this prevents was a wrong proposal issue, not a red check.

I did not run the full suite. The forge runs it on the push.

Approved

Both earlier asks are met: emphasis-wrapped lead-ins (Smaller points:, _Fix in the same round:_) are dropped by isLeadIn, and a real finding that merely contains a colon (High: ...) is kept, with tests for each. The bullet regex now requires whitespace after the marker, so bold text no longer loses a character. The change is small, single-purpose, adds no dependency, and does not touch the pipeline work.

Non-blocking: a real list item ending in a colon is still dropped. You accepted that and named it, so I leave it. Non-blocking: if the repeat detector ever surfaces a lead-in again, a one-line gate message naming the rule would satisfy box 2. Today nothing fails, so there is no message.

Box 1 is met: the test fails without the fix. Box 2 is left. The rule is named in the doc comment, but no check fails with a message, so the box as written does not hold.

commented

Left #8838 open: 1 unticked item remain (The check names the rule in its failure message.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs