Repository navigation
Compose pr_review.py's Block Shapes From One Primitive Each - #3261
Conversation
The ATX heading, the thematic break, and the fence opener each get one spelling, and FENCE, INTERRUPTS_PARAGRAPH, MARKDOWN_HEADING, and coverage_statements' block-closing test compose from them. The closing test took a vertical tab after a heading's hashes and refused a thematic break or setext underline spaced by tabs, and MARKDOWN_HEADING read only a heading carrying text after its hashes. Each now reads the shape the way GitHub renders it, with those cases pinned. Refs #3241 Co-Authored-By: Claude Opus 5.5 <[email protected]>
HEADING spelled the heading shape out with Python's \s after the hashes, so a no-break space there opened a section where GitHub renders text. The reachable no-break-space case is pinned at the regex and through coverage_statements. Refs #3241 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #3241 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟢 Approval recommended
The remaining comment is documentation-only, and the supplied readiness assessments approve the changes.
No open issues 🎉
What changed in this PR
This PR consolidates Markdown block-shape regexes into reusable primitives and adds GitHub-compatible regression coverage.
Changes:
- Composes heading, thematic-break, fence, and line-ending patterns.
- Updates block readers to use shared primitives.
- Adds tests for tabs, no-break spaces, bare headings, and fence behavior.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Adds regression tests for whitespace-sensitive Markdown parsing. |
scripts/pr_review.py |
Defines and composes shared block-shape primitives. Includes a P2 (moderate) docstring wording comment. |
Review effort: Lite
|
Answering the round on |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3261 +/- ##
==========================================
Coverage ? 65.40%
==========================================
Files ? 17
Lines ? 9991
Branches ? 0
==========================================
Hits ? 6535
Misses ? 3456
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…and File-Naming Check to Main (#3266) ## Summary Promotes eight pull requests from develop. Three are `pr_review.py` reader fixes from this round, one answers this promotion's first review, and four are from other sessions. - #3261: each heading, thematic-break, and fence shape in `pr_review.py` has one primitive that every reader composes from. A no-break space after a heading's hashes no longer opens a heading, and a tab-spaced thematic break or setext underline closes its block. - #3262: when `wait` returns `50` at once on an uncounted-verdict head while a check has not concluded, it names a bounded `gh pr checks --watch` to watch the checks with. - #3264: `CODE_SPAN` reads code spans, raw inline HTML, and autolinks left to right, as GitHub binds them, so a backtick inside an earlier HTML comment, tag, or autolink opens no span. A line of only blockquote markers now ends a paragraph. - #3256: `pr_review.py wait` reads a superseded run's failed aggregator as superseded rather than as a verdict on the head. - #3258: a `driftNote` can exempt a tool-fixed script name from the file-naming check. - #3253: an audit check for file naming, including secret-file stem casing. - #3249: the Linux quick start names the no-sudo Debian case. - #3267: splits the over-long and two-instruction sentences that this promotion's first Copilot round found in #3249's paragraph. Closes #3241 Closes #3246 Closes #3235 Closes #3252 Closes #3254 Closes #3141 Closes #2551 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Gives each block shape in
scripts/pr_review.pyone spelling, and has the other sites compose from it (#3241).ATX_HEADINGandTHEMATIC_BREAKhold the heading and thematic-break shapes.fence_openerholds a fence's opening line, andFENCEpasses it capturing runs so its closer can repeat the opener's mark.FENCE,INTERRUPTS_PARAGRAPH,MARKDOWN_HEADING,HEADING, andcoverage_statements' block-closing test all compose from those primitives.LINE_ENDmoves up soFENCE's closer can use it.FENCE's matches andINTERRUPTS_PARAGRAPH's truthiness unchanged.Behavior that changes, each case checked against GitHub's renderer
\stook one inMARKDOWN_HEADING,HEADING, and the coverage closing test.coverage_statements. Before, it was read as paragraph text, and an indented marker under it was read as stated coverage.#line is now a heading, which GitHub renders as an empty<h1>. The local review traced each call site: it ends a headline, reportsheading: #as unvetted, and stops a<summary>fold. Each of those matches what GitHub renders.Each case is pinned by a test, and each new assertion fails with the fix reverted.
Filed along the way
str.splitlinessplits a body where GitHub does not, so a vertical tab or a form feed after a heading's hashes never reaches these readers as one line.\s*takes a no-break space and any indentation.Refs #3241
🤖 Generated with Claude Code