Repository navigation
Conversation
## Summary `CODE_SPAN` in `scripts/pr_review.py` ended an inline code span only at a blank line. GitHub also ends a paragraph at a line opening an HTML block, so a stray backtick before `</details>` paired with the first tick of the next entry's summary, and `unwrap` printed the wrappers between them raw. Implements #3214. - `HTML_BLOCK_START` holds the GFM block starts that may interrupt a paragraph (types 1 to 6), and `CODE_SPAN` does not continue onto such a line. Type 6 reuses `tag_opener`, which gains a `closer` flag and moves above its first use. - `attestation()` drops its span mask. The marker is anchored to a line of its own, which a span can no longer reach, so the mask changed nothing. The maintainer chose to follow GitHub's rendering here: a trusted author's marker on its own line between two stray ticks is a real HTML comment, so it now attests. - Two tests encoded a span crossing such a line and now read it as GitHub renders it. The `stated_total` test now pins the offset alignment the opener mask provides. ## Verification - The constructed case from #3214 fails with the fix reverted and passes with it. Each block-start alternative and the case-insensitive group were mutation-checked against the new rows. - `python3 -m unittest discover -s tests`: OK. ruff, ruff format, mypy, `repo_gate.py`, the prose gate (whole tree and `--diff origin/develop`), and `build_dist.py --check` are clean. - Local strict review: two rounds. Round one's introduced findings were fixed in 3a33b75, and round two raised none. ## Follow-ups filed - #3227: a span still pairs across a list item, heading, blockquote, or thematic break. This was already true before this change. - #3228: the HTML block name list here and `INTERRUPTING_TAGS` in `prose_lint.py` disagree on `source` and `search`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…s in pr_review.py (#3230) ## 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](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3231 +/- ##
==========================================
+ Coverage 65.52% 65.57% +0.05%
==========================================
Files 17 17
Lines 9771 9782 +11
==========================================
+ Hits 6402 6415 +13
+ Misses 3369 3367 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved findings remain for blockquote-aware HTML boundaries, complete tag validation, and the attestation docstring.
2 open issues
What changed in this PR
This PR aligns HTML block handling and shared tag-attribute parsing with GitHub behavior, with updated regression tests.
Changes:
- Prevents code spans from crossing recognized HTML blocks.
- Shares attribute-tail parsing for
<details>and<summary>. - Updates attestation and parser test coverage.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Adds regression coverage for parsing, code spans, totals, and attestations. |
scripts/pr_review.py |
Implements shared parsing, HTML block boundaries, and attestation behavior. |
Review effort: Lite
#3232) ## Summary This answers Copilot's P2 on promotion #3231. Once #3229 removed the span mask in front of `attestation()`, a trusted marker on a line of its own between two stray ticks attests, as GitHub renders it. The docstring still said a marker "in a span" vouches for nothing. It now says a marker quoted inline or in a code block vouches for nothing, and that a tick on each side of the marker's own line opens no span, so the marker still counts. ## Verification - The change is docstring-only. ruff, ruff format, the `pr_review` suite, and the prose gate with `sentence-length` are clean, and the pre-commit gate passed at commit. - The local strict review checked each claim against `ATTESTATION`, `strip_fences`, and the `TestAttestationReadings` rows, and raised no findings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Copilot's round on f1e5727 says "Needs a closer look" with the headline "Self-closing HTML block openers are not yet recognized as span boundaries". It names no line and no case, and it opened no thread. Checked against the code on this head and against GitHub's renderer (
|


pr_review.pyat 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 ofattestation()is gone.<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