fix(check-md032): indented blockquote inside list-item body is NOT a list terminator (PR #3075 follow-up)#3091
Conversation
…list terminator (PR #3075 follow-up) After PR #3075 merged, running the helper across the full `docs/hygiene-history/**` corpus (584 files) surfaced 2 false positives on `docs/hygiene-history/ticks/2026/05/13/0645Z.md` at lines 24-25: ``` - bullet describes a thing > the thing's exact quoted words ← indented `>`, not column 0 - next bullet ← falsely flagged as new list ``` The round-15 / round-16 work added "blockquote line terminates a top-level list" + "after-list MD032 fires on the blockquote line when no blank separator." The `isBlockquoteLine` regex (`^ {0,3}>`) matched both column-0 AND 1-3-space-indented `>` lines. But an indented `>` (1+ spaces) is part of the enclosing list-item body / continuation indent, NOT a new top-level block — it shouldn't terminate the list. Fix: tighten `isBlockquoteLine` to column-0 only (`^>`). A 2-space- indented `> quote` line is now correctly treated as list-item-body content, and the list continues to the next bullet without firing either MD032 side. Tests: 76 pass (+2). New cases: - Indented blockquote inside list-item body: clean - Column-0 blockquote between bullets still terminates (control) Validation: helper run across the full `docs/hygiene-history/**` corpus (584 files) now returns clean — confirming the fix is the correct calibration rather than over-relaxation. Round 15/16 tests with column-0 blockquote ("blockquote line after top-level list terminates") still pass unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR narrows MD032 blockquote termination handling to avoid false positives for blockquote-looking lines inside list-item bodies.
Changes:
- Updates
isBlockquoteLineto match only column-0>lines. - Adds regression coverage for indented blockquotes inside list items and column-0 blockquote controls.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tools/hygiene/check-md032-blanks-around-lists.ts |
Adjusts blockquote-line detection logic. |
tools/hygiene/check-md032-blanks-around-lists.test.ts |
Adds round-20 regression tests for the MD032 false-positive case. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 671b60b72a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…20 P1 review on the round-20 fix)
The round-20 commit (this PR's first push) tightened
`isBlockquoteLine` from `^ {0,3}>` to `^>`, which over-corrected.
Per CommonMark, a top-level blockquote can have 0-3 leading
spaces; the round-20 false-positive was specifically about a
2-space-indented `>` being treated as top-level when it was
actually a child block of a list-item body.
The calibration: list-item continuation indent is typically 2
spaces (for `- item` / `* item` / `+ item`); a `>` at 2-3 leading
spaces is therefore usually a child block. A `>` at 0-1 leading
spaces is unambiguously top-level. The new regex `^ {0,1}>`
captures this calibration.
Reviewer rationale (composed):
- Copilot P1: 1-space-indented `>` after `- item` IS still
top-level per CommonMark; my round-20 `^>` regressed it
- Codex P2: `- a / ` ` > quote / - b` now misses the after-list +
before-list MD032 findings markdownlint reports
New test asserts the 1-space-indented top-level blockquote
terminates the surrounding list (composing with the existing
column-0 and indented-blockquote-as-child-body tests).
Tests: 77 pass (+1, on stable run; one temp-git-repo test is
timing-flaky at 5s timeout — passes on rerun).
Validation: full `docs/hygiene-history/**` corpus (584 files)
still returns clean.
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afc97c48dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // case and regressed Copilot's `- a / ` `> quote` (one-space- | ||
| // indented top-level) case. `^ {0,1}>` is the calibration that | ||
| // matches Copilot + Codex round-20 input shapes. | ||
| return /^ {0,1}>/.test(line); |
There was a problem hiding this comment.
Account for ordered-list indent in blockquote termination
isBlockquoteLine now treats any 2+-space-indented > as list-item body, but in ordered lists the continuation indent depends on marker width, so 1. item followed by > quote is a top-level blockquote that terminates the list per markdownlint. In findMd032Violations, this misclassification keeps inList === "top", so the following list item is treated as a continuation and MD032 is missed (false negative) for valid inputs like 1. a / two-space-indented blockquote / 1. b.
Useful? React with 👍 / 👎.
…ded (hook wiring deferred) (#3092) * chore(tick): 0314Z shard — PR #3091 MERGED; B-0456 arc fully closed; 18 PRs this session Co-Authored-By: Claude <noreply@anthropic.com> * fix(tick/0314Z): drop leading `#` from PR references at line start (MD018) `#3075` at column 0 was parsed by markdownlint as an attempted ATX heading (MD018: no space after hash). Dropping the `#` prefix on the wrapped line keeps the meaning ("PR 3075") without triggering the lint. Co-Authored-By: Claude <noreply@anthropic.com> * fix(tick/0314Z): correct relative link + accuracy on B-0456 status Two Copilot P1 findings: 1. The relative link `../../tools/...` from a shard at depth `docs/hygiene-history/ticks/2026/05/14/` did NOT resolve to the repo `tools/` directory (it pointed under `docs/hygiene- history/ticks/2026/tools/`). Replaced the broken link with an inline code-span reference — the path is still readable and doesn't drift to a wrong file. 2. The "B-0456 arc fully closed" claim conflicts with the row's actual status (`status: open` in `docs/backlog/P2/B-0456-...md`) — acceptance criterion #4 (wire helper into pre-push hook OR tick-close ritual) is still deferred. Reworded shard title + body to "implementation landed; hook wiring deferred." Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
PR #3075 merged earlier this session shipped the MD032 helper with a round-15 + round-16 fix that treats a blockquote line as a list-block terminator. Post-merge validation across the full
docs/hygiene-history/**corpus (584 files) surfaced 2 false positives on 0645Z.md:24-25:The
isBlockquoteLineregex (^ {0,3}>) matched both column-0 AND 1-3-space-indented>lines. But an indented>is part of the enclosing list-item body, NOT a new top-level block — it shouldn't terminate the list.Fix
Tightened
isBlockquoteLineto column-0 only (^>). A 2-space-indented> quoteis now correctly treated as list-item-body content, and the list continues to the next bullet without firing either MD032 side.Test plan
docs/hygiene-history/**corpus (584 files) now returns clean🤖 Generated with Claude Code