Skip to content

Share One Attribute Tail Across the Details and Summary Opener Readers in pr_review.py - #3230

Merged
ptr727 merged 3 commits into
developfrom
feature/opener-attribute-tail
Oct 19, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/opener-attribute-tail

Conversation

@ptr727

@ptr727 ptr727 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

scripts/pr_review.py ended each <details> or <summary> opener's name through one primitive, tag_opener, but each reader spelled the attribute tail after it on its own. One of them, [^>]*>, read an opener quoted in code as <details [^>]*> as a tag that ate the text after it up to the next >. Implements #3212.

  • attributes(spanning, lone_space) is the one tail. SUMMARY, DETAILS_OPENER, and DETAILS_TAG move onto it beside TAGS and HTML_TAG, which already used ATTRIBUTES.
  • A quoted value may hold a >, and anything that is not an attribute ends the tag unread.
  • spanning readers (SUMMARY, DETAILS_TAG) take a line break between attributes and inside a quoted value, as HTML does. The others read one line.
  • lone_space=False keeps SUMMARY's refusal of the <summary > a code span masked to a space leaves.
  • HTML_SPACE names the HTML whitespace class that tag_opener, attributes, and the HTML block start each spelled out.
  • A table test pins, at every tail reader, an attributed, a quoted->, and a self-closed opener as read, and <details [^>]*> as not read. Multi-line rows cover the two spanning readers.

Verification

  • The table test fails 10 subtests against the pre-change readers. Six targeted mutations of the new primitive each fail the suite.
  • python3 -m unittest discover -s tests: OK. ruff, ruff format, mypy, repo_gate.py, the prose gate (whole tree, and the diff with sentence-length), and build_dist.py --check are clean.

Local review findings still open

The local strict review ran two rounds, and the edit budget is spent. One finding remains:

  • introduced: the letter-only lead on an attribute name, which SUMMARY needs so a masked span cannot supply a name, also narrows TAGS and HTML_TAG. So unwrap now leaves <details :open> or <summary _id="a"> raw where it stripped them before. Fixed in 8dad7fb, which keeps the letter-only lead to lone_space=False and gives the other readers CommonMark's [A-Za-z_:] lead. Its own local pass raised nothing.

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 19, 2026 08:47
…s in pr_review.py

`attributes` is the one tail after an opener's name, so an opener quoted in code as
`<details [^>]*>` is no tag to any reader, and a quoted value holding a `>` is read whole.

Fixes #3212

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n a Letter

The readers spanning lines read a line break inside a quoted value again, an attribute name opens
on a letter so a masked span cannot supply one, and one HTML whitespace class serves every reader.

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

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

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

@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: 4d3b7f29-5a56-4c1b-be7b-374f8e95ebda
  • 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.

`TAGS` and `HTML_TAG` read a name opening on `_` or `:` again, as CommonMark does, so `unwrap`
strips `<details :open>` as it did before. `SUMMARY` alone keeps the letter-only lead.

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

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

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

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

The shared parser regresses attribute names beginning with : or _.

1 open issue
What changed in this PR

This PR centralizes HTML attribute-tail parsing across pr_review.py readers and adds regression coverage.

Changes:

  • Adds shared parsing with quoted > and multiline support.
  • Updates summary/details and tag readers.
  • Adds table-driven opener tests.

Review finding: preserve : and _ attribute-name leads for shared readers (moderate, 4 votes).

File Description
scripts/​pr_review.py Adds shared attribute parsing and updates readers.
tests/​test_pr_review.py Adds coverage for valid, malformed, quoted, and multiline openers.

Review effort: Lite

Comment thread scripts/pr_review.py Resolved
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@c39d7f8). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #3230   +/-   ##
==========================================
  Coverage           ?   65.57%           
==========================================
  Files              ?       17           
  Lines              ?     9782           
  Branches           ?        0           
==========================================
  Hits               ?     6415           
  Misses             ?     3367           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 65.57% <100.00%> (?)

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 f7ea5f2 into develop Oct 19, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/opener-attribute-tail branch October 19, 2026 16:36
ptr727 added a commit that referenced this pull request Oct 19, 2026
…il to Main (#3231)

- #3229 ends an inline code span in `pr_review.py` at a line opening a
GFM HTML block, as GitHub renders it. So a stray backtick no longer
pairs across `</details>` or `<details>`, and the digest no longer
prints those wrappers raw. A trusted author's attestation marker on a
line of its own between two stray ticks now attests, which is the
maintainer's "follow GitHub" decision, and the dead span mask in front
of `attestation()` is gone.
- #3230 gives the `<details>` and `<summary>` opener readers one
attribute tail, `attributes()`. An opener quoted in code as `<details
[^>]*>` is no tag to any of them, and a quoted value holding a `>` is
read whole. The readers spanning lines take a line break where HTML
does.

Neither change edits a skill, so this machine's installed Skills are
unchanged at release.

Closes #3214
Closes #3212

🤖 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