Skip to content

Recognize a Details or Summary Opener Through One Primitive in pr_review.py - #3209

Merged
ptr727 merged 5 commits into
developfrom
feature/tag-opener-primitive
Oct 18, 2026
Merged

ptr727 merged 5 commits into
developfrom
feature/tag-opener-primitive

Conversation

@ptr727

@ptr727 ptr727 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Every reader of a <details> or <summary> opener in scripts/pr_review.py now ends the tag name through one primitive, tag_opener, on CommonMark's rule: HTML whitespace, the end of a line, >, or />.

  • DETAILS_OPEN, SUMMARY, DETAILS_OPENER, HEADING, DETAILS_TAG, FOLD_OPENER, and FOLD_STOP build on it, and a new SUMMARY_OPENER serves HEADING, FOLD_OPENER, and heading_of.
  • HEADING and heading_of had no boundary at all, so <summaryx> opened a heading line.
  • heading_of now reads the heading through one anchored SUMMARY.match, so a block whose own summary SUMMARY rejects no longer takes a nested entry's summary as its heading.
  • A table test pins <name>, <name\tid="a">, and <name/> as an opener and <namex>, <name plus a no-break space, and <name/x> as none, at every site, plus the end-of-line arm.

TAGS, which strips only a bare tag, is left as it is and filed as #3208.

Part of #3206.

Local review findings

The two findings the local pass first listed here, a 28-word tag_opener docstring sentence and a table test duplicating its neighbour, are fixed in 905fdd0. A later pass found the change to heading_of's first guard unpinned, fixed in 2d41e44. The pass over the current head raised nothing.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of HTML <details> and <summary> tags with varied whitespace and opener formats, including incomplete tag prefixes.
    • Corrected heading selection so nested summaries no longer take precedence over the outer heading.
  • Tests
    • Expanded coverage for tag-name boundaries, supported opener formats, and heading selection.

ptr727 and others added 3 commits October 18, 2026 15:00
…iew.py

Every reader of a `<details>` or `<summary>` opener now ends the tag name
where Markdown does, through `tag_opener`. `HEADING` and `heading_of` had
no boundary at all, so `<summaryx>` opened a heading line, and the fold
and summary readers each disagreed on `<summary/>` and `<details/x>`.

Fixes #3206

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Answers the local review of the tag-opener primitive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Answers the second local review of the tag-opener primitive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 18, 2026 22:19
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5071feab-410d-4a99-b728-b54c80be50b6
📥 Commits

Reviewing files that changed from the base of the PR and between 213ac08 and 2d41e44.

📒 Files selected for processing: 2
  • scripts/pr_review.py
  • tests/test_pr_review.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The pull request adds a shared HTML tag-opener helper and updates details and summary readers to use bounded tag-name patterns. It also changes heading extraction and summary folding, and adds tests for tag boundaries and heading selection.

Changes: Tag parsing

Layer / File(s) Summary
Shared tag opener patterns
scripts/pr_review.py, tests/test_pr_review.py
A shared helper defines tag-name boundaries. Details and summary opener patterns use it. Tests cover accepted whitespace and opener forms, name suffixes, and incomplete prefixes.
Reader integration
scripts/pr_review.py, tests/test_pr_review.py
Heading extraction, nested-details parsing, and summary folding use the shared opener patterns. Tests cover heading extraction with spaced, multiline, and name-suffixed summary openers.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 2d41e

No actionable issue remains; the change is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: using one primitive to recognize <details> and <summary> openers in pr_review.py.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (1 skipped: 1 too large.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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 18, 2026

Copy link
Copy Markdown
Owner Author

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

…ong Docstring Sentence

Answers the two findings the local review left listed on the pull request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Address the outstanding documentation and overlapping-test findings before approval.

2 open issues
What changed in this PR

Centralizes HTML opener parsing in pr_review.py and adds regression coverage for tag boundaries and heading extraction.

Changes:

  • Adds shared opener primitives.
  • Updates heading, folding, and details parsing.
  • Adds boundary and nested-heading tests.
File Description
tests/​test_pr_review.py Added opener boundary and nested-heading regression tests.
scripts/​pr_review.py Centralized opener recognition and updated heading/detail readers.

Review effort: Lite

Comment thread scripts/pr_review.py Resolved
Comment thread tests/test_pr_review.py Resolved
@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.50%. Comparing base (213ac08) to head (2d41e44).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3209      +/-   ##
===========================================
+ Coverage    65.49%   65.50%   +0.01%     
===========================================
  Files           17       17              
  Lines         9758     9761       +3     
===========================================
+ Hits          6391     6394       +3     
  Misses        3367     3367              
Flag Coverage Δ
python-3.13 65.50% <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 18, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727

ptr727 commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 9a23b7d into develop Oct 18, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/tag-opener-primitive branch October 18, 2026 22:46
ptr727 added a commit that referenced this pull request Oct 19, 2026
…ain (#3210)

- #3209 makes every reader of a `<details>` or `<summary>` opener in
`pr_review.py` end the tag name through one primitive, `tag_opener`, on
CommonMark's rule: HTML whitespace, the end of a line, `>`, or `/>`.
`HEADING` and `heading_of` had no boundary at all, so `<summaryx>`
opened a heading line. `heading_of` now reads the heading through one
anchored `SUMMARY.match`, so a block whose own summary is rejected no
longer takes a nested entry's summary as its heading. `TAGS`, which
strips only a bare tag, is filed as #3208.

The change is to scripts and tests only, so no installed Skill changes
at release.

Closes #3206

🤖 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants