Skip to content

Promote the Shared Paragraph-End Model and Container-Bounded Tag Indent to Main - #3245

Merged
ptr727 merged 2 commits into
mainfrom
develop
Oct 20, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes two paragraph-boundary fixes, one in pr_review.py and one in the prose gate's prose_lint.py, from develop.

  • End a Code Span at Every Paragraph-Ending Line in pr_review.py #3242: CODE_SPAN and the quoted-coverage reader share one model of a line that interrupts a paragraph. That model covers list items, ATX headings, thematic breaks, fence openers, and HTML block starts, with or without blockquote markers, and GitHub's renderer settled each shape. An HTML block name ends at a vertical tab, and a test holds that boundary equal to the prose gate's.
  • Bound a Paragraph-Interrupting Tag Line's Indent by Its Container in prose_lint.py #3244: the prose gate ends a paragraph at a block tag line only within three columns of the open paragraph's container. An item's content column counts the marker's spaces in tab-expanded columns, and every empty item marker is read as an item where GitHub reads one.

Closes #3227
Closes #3236
Closes #3243

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 19, 2026 16:05
## Summary

`CODE_SPAN` in `scripts/pr_review.py` paired a stray backtick across a
list item, a heading, a thematic break, or a fence opener, because it
ended a span only at a blank line or an HTML block start. It now ends a
span at every line that interrupts a paragraph, from one shared pattern,
`INTERRUPTS_PARAGRAPH`. `STARTS_BLOCK`, which ends a quotation's lazy
continuation in `coverage_statements`, is now that same pattern.

- GitHub's renderer settled each shape the tests pin, in both
directions. A list item ends a paragraph only with content, and an
ordered one only at 1. A zero-padded `0001.` counts. `####### h` and
`#h` do not.
- A line opening such a block behind blockquote markers ends a span too.
A bare quoted line still continues a quoted span, since it does on
GitHub.
- An HTML block name now ends at a vertical tab (`BLOCK_SPACE`), as the
#3227 comment asked. The agreement test holds that constant equal to the
prose gate's.
- One existing test quoted a bullet across a span opened on the line
above. GitHub ends that paragraph at the bullet, so the test now quotes
the sentence spelling.

Fixes #3227

## Local review

There were three recorded `local-strict-review` passes. Pass 1 raised a
setext-underline regression inside containers (fixed by dropping that
arm) and a quoted block-start gap (fixed). Pass 2 raised exponential
backtracking in the new quote prefix (fixed, now linear). Two
pre-existing findings were filed as #3240 and #3241.

The edit budget was spent with one `introduced` finding open: the quote
prefix allowed three spaces between two markers where GitHub allows
four. Copilot raised it too, and 0ce5c6a fixed it under a fourth
recorded pass, which found nothing further.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…prose_lint.py (#3244)

## Summary

`OPENING_TAG` in the prose gate matched a block tag at any indent, so a
tag line indented four or more columns under a paragraph ended it, where
GitHub reads it as lazy continuation text. The sentence-length check
then measured two short sentences where GitHub shows one.

- A tag line now ends the open paragraph only within three columns of
that paragraph's container. The reference is captured when the paragraph
opens: 0 at the top level, or the list item's content column inside an
item.
- `content_offset` gives an item's content column the way CommonMark
does: the marker's run of up to four spaces, or one past the marker
where five or more follow or the item is empty. The `code_indent`
reading of an item's indented code follows the same column now, which
corrects a six-column paragraph under `- ` that was read as code.
- A bare `-` with no paragraph open sets the list state as an empty
item.
- GitHub's renderer checked every tested shape. A base-vs-head run of
`sentence_length_findings` over all tracked Markdown files shows no
difference.

Fixes #3236
Fixes #3243

## Local review

There were three recorded `local-strict-review` passes. Pass 1 found
that a lazy line moved the reference and that `marker.end()` missed the
marker's spaces, both fixed. Pass 2 found the bare `-` empty item,
fixed. A related `CODE_SPAN` case went onto #3240.

The edit budget was spent with one `introduced` finding open: an empty
item opening on `*`, `+`, `1.`, or `1)`. Copilot raised it too, along
with item columns after a tab. The review loop fixed both: the splitter
reads items through its own `ITEM_MARKER`, which accepts the end of the
line, and an empty item interrupts an open paragraph only from outside
its container. That closes #3243 instead of deferring to it. Two further
recorded passes found nothing open.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 19, 2026 23:52
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71ceecec-e4de-4535-962b-0c1182e90acc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A moderate tab-aware blockquote handling issue remains in scripts/pr_review.py.

No open issues 🎉

What changed in this PR

Promotes shared paragraph-boundary parsing and container-aware tag indentation fixes to main.

Changes:

  • Unifies paragraph-interruption detection in review parsing.
  • Bounds prose-gate tag indentation to list containers.
  • Adds regression coverage for both behaviors.
  • Requires tab-aware blockquote handling in scripts/pr_review.py.
File Summary
tests/​test_prose_lint.py Tests tag indentation and empty list items.
tests/​test_pr_review.py Tests paragraph boundaries and code spans.
scripts/​pr_review.py Shares paragraph-boundary handling; tab-aware blockquote spacing remains to be addressed.
.github/​actions/​prose-gate/​prose_lint.py Implements container-aware tag and list parsing.

Review effort: Lite

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.60%. Comparing base (1dbddd7) to head (36251ed).
⚠️ Report is 404 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3245      +/-   ##
==========================================
+ Coverage   65.59%   65.60%   +0.01%     
==========================================
  Files          17       17              
  Lines        9787     9790       +3     
==========================================
+ Hits         6420     6423       +3     
  Misses       3367     3367              
Flag Coverage Δ
python-3.13 65.60% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

On the headline's tab-aware blockquote handling: confirmed real. GitHub ends the paragraph at > followed by a tab and - c, while CODE_SPAN pairs across that line. It is not a regression, since before #3242 no quoted line ended a span at all, and it sits in the same class as #3240: a tab's width depends on the column it starts at, which a line-level pattern cannot measure. Deferred there, with the constructed case recorded in #3240 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants