Skip to content

End a Code Span at Every Paragraph-Ending Line in pr_review.py - #3242

Merged
ptr727 merged 3 commits into
developfrom
feature/paragraph-end-model
Oct 19, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/paragraph-end-model

Conversation

@ptr727

@ptr727 ptr727 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

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 End a Code Span at Every Paragraph-Ending Block Start in pr_review.py #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

ptr727 and others added 2 commits October 19, 2026 15:36
CODE_SPAN and the quoted-coverage reader now share one model of a line
that interrupts a paragraph: a list item with content, an ordered item
at 1, an ATX heading, a thematic break, a fence opener, and an HTML
block start, each shape settled by GitHub's renderer. A span also ends
where such a line sits behind a blockquote marker. An HTML block name
now ends at a vertical tab too, and a test holds that boundary equal
to the prose gate's.

Fixes #3227

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 19, 2026 22:43
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Oct 19, 2026
@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: 1aaa91c7-afbe-45a9-b1bd-85572229d669
  • 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.

@ptr727

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 27572e27fd3e3316d0388ef4b156da775bf3599d, the content this pull request carries at that commit against develop, and it recorded 1 finding.

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.

🟡 Changes recommended

Nested blockquote detection must support four spaces between markers.

1 open issue
What changed in this PR

This PR centralizes Markdown paragraph-interruption detection for code-span masking and coverage parsing, with expanded regression tests.

Changes:

  • Adds shared block and whitespace patterns.
  • Updates span and coverage parsing.
  • Adds boundary tests for lists, headings, fences, quotes, and HTML blocks.
File Summary
tests/​test_pr_review.py Adds regression coverage for Markdown boundaries.
scripts/​pr_review.py Implements shared paragraph-interruption matching.

Review effort: Lite

Comment thread scripts/pr_review.py Resolved
@ptr727

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 0ce5c6a9c947bc50f3a636fe83f87c6ecbbe8bcb, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@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.58%. Comparing base (1dbddd7) to head (0ce5c6a).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3242      +/-   ##
===========================================
- Coverage    65.59%   65.58%   -0.01%     
===========================================
  Files           17       17              
  Lines         9787     9790       +3     
===========================================
+ Hits          6420     6421       +1     
- Misses        3367     3369       +2     
Flag Coverage Δ
python-3.13 65.58% <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 merged commit bd7f23a into develop Oct 19, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/paragraph-end-model branch October 19, 2026 23:06
ptr727 added a commit that referenced this pull request Oct 20, 2026
…nt to Main (#3245)

## Summary

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

- #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.
- #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](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants