Skip to content

Promote the Details and Summary Opener Primitive in pr_review.py to Main - #3210

Merged
ptr727 merged 1 commit into
mainfrom
develop
Oct 19, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 18, 2026

Copy link
Copy Markdown
Owner

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

Closes #3206

🤖 Generated with Claude Code

…iew.py (#3209)

## 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](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 18, 2026 22:46
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 13777f63-fb74-45a3-b4bc-e47adca928f0
📥 Commits

Reviewing files that changed from the base of the PR and between 0e3cb08 and 9a23b7d.

📒 Files selected for processing: 2
  • scripts/pr_review.py
  • tests/test_pr_review.py
  • 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.

🟢 Approval recommended

All reviewed changes have no unresolved blocking issues.

No open issues 🎉

What changed in this PR

Promotes shared HTML tag-opener parsing in pr_review.py and adds regression coverage for heading selection and tag boundaries.

Changes:

  • Centralizes <details> and <summary> opener recognition.
  • Prevents malformed or nested summaries from being misread.
  • Adds boundary and heading-selection tests.
File Description
tests/​test_pr_review.py Adds opener-boundary and heading regression tests.
scripts/​pr_review.py Implements shared opener matching and anchored heading parsing.

Review effort: Lite

@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 not completed

Review rate limited.

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.

@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 (9a23b7d).
⚠️ Report is 397 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3210      +/-   ##
==========================================
+ 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 merged commit d2e732d into main Oct 19, 2026
14 checks passed
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.

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

2 participants