Skip to content

Promote the Attributed Opener Stripper in pr_review.py to Main - #3216

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 19, 2026

Copy link
Copy Markdown
Owner

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

Closes #3208

🤖 Generated with Claude Code

…ew.py (#3213)

## Summary

`TAGS` in `scripts/pr_review.py` now strips an attributed or self-closed
`<details>` or `<summary>` opener the same way it strips a bare one.
Before this, `<details open>`, `<summary class="x">`, and `<summary/>`
printed raw from `unwrap`, and a closer-less attributed heading failed
its `entry_heading` read.

- The opener arm ends the tag name through `tag_opener`, so `<summaryx>`
and `<details/x>` stay text.
- The attribute tail is `HTML_TAG`'s existing grammar, which both
readers now share as `ATTRIBUTES`. `HTML_TAG`'s compiled pattern is
unchanged. The grammar keeps prose such as `<details element's open
attribute -> false` as text, reads a `>` inside a quoted value as part
of the tag, and stops at the opener's own line.
- `unwrap` finds its tags in a copy with every fence and code span
masked, then cuts them from the original at the same offsets. So a
finding that quotes `` `<details open>` `` in code keeps it.
- A test pins the stripped shapes, the kept shapes, the line bound, the
quoted and prose cases, and the `entry_heading` read. Each assertion
fails on the code it replaces.

Part of #3208.

## Local review findings

A recorded `local-strict-review` pass covers the current head, and it
raised nothing. Earlier passes found these, all fixed on this branch:

- A `[^>]*>` tail ate code-span text, fixed in ec80b66.
- Requiring a letter after the whitespace left `<summary />` raw, fixed
in 27ea68b.
- The tail accepted prose as an attribute run, fixed in bc54c3a.

Filed rather than fixed here:

- #3212: the attribute tail is still spelled separately at the other
opener readers.
- #3214: `CODE_SPAN` pairs a stray backtick across an HTML block line,
which can leave a wrapper tag printed raw.
- #3215: `reduced` strips an emphasis tag quoted in code.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 19, 2026 02:44
@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: 44799fcb-6416-46fa-b5b1-6ed187b23677
  • 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

Quoted code spans are removed before masking, causing the new quoted-markup behavior to fail.

No open issues 🎉

What changed in this PR

Promotes attributed and self-closing <details>/<summary> stripping in pr_review.py, with regression coverage.

Changes:

  • Shares HTML attribute parsing between tag readers.
  • Updates quotation-aware unwrapping.
  • Adds tests for attributes, boundaries, and quoted markup.
File Summary
tests/​test_pr_review.py Adds regression tests for tag handling.
scripts/​pr_review.py Updates tag parsing and unwrapping behavior.

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.52%. Comparing base (9a23b7d) to head (d557c3d).
⚠️ Report is 398 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3216      +/-   ##
==========================================
+ Coverage   65.50%   65.52%   +0.02%     
==========================================
  Files          17       17              
  Lines        9761     9767       +6     
==========================================
+ Hits         6394     6400       +6     
  Misses       3367     3367              
Flag Coverage Δ
python-3.13 65.52% <100.00%> (+0.02%) ⬆️

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

Answering the round's headline, "Quoted code spans are removed before masking, causing the new quoted-markup behavior to fail": declined, the claim does not hold on this head.

unwrap runs reduced before mask_quotations, and reduced is EMPHASIS.sub("", SEVERITY_BADGE.sub(badge_text, text)). EMPHASIS is </?(?:strong|b|em|i)>, and SEVERITY_BADGE reduces the severity badge markup to its word. Neither touches a backtick, so every code span reaches the masking intact. Probed against develop at d557c3d:

unwrap("Keep `<details open>` here.")      -> "Keep `<details open>` here."
unwrap("Keep **`<details open>`** here.")  -> "Keep **`<details open>`** here."
unwrap("Keep ``<details open>`` x")        -> "Keep ``<details open>`` x"
unwrap("Keep <b>`<summary>`</b> x")        -> "Keep `<summary>` x"

test_a_render_strips_an_attributed_opener_as_it_strips_a_bare_one pins the quoted cases, and it fails when the masking is reverted. The one related gap is an emphasis tag quoted in code, which reduced does strip, and that is filed as #3215.

@ptr727
ptr727 merged commit 07b0a52 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.

Strip an Attributed Details or Summary Opener Through TAGS in pr_review.py

2 participants