Skip to content

Keep an Emphasis Tag Quoted in Code When reduced Strips Emphasis in pr_review.py - #3234

Merged
ptr727 merged 4 commits into
developfrom
feature/emphasis-tag-in-code
Oct 19, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/emphasis-tag-in-code

Conversation

@ptr727

@ptr727 ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • reduced dropped every emphasis tag before any quotation was masked, so a finding quoting <strong> or <b> in code printed Prefer `` over ``.. It now finds the tags in a copy with every quotation masked.
  • The severity-badge reduction beside it had the same defect, so a badge quoted in a fence printed as its alt text. Both now go through one quote-aware unquoted_sub, which unwrap's TAGS drop shares in place of its own inline loop.
  • normal, unwrap, and heading_count still read the one reduction, so vetted, printed, and counted text move together. Every vetting path already masks quotations before reaching normal, so no vetting result changes.

Fixes #3215

Verification

  • tests/test_pr_review.py: 931 tests pass. The new test fails against the base reduction on its unwrap, fenced, mixed, and quoted-badge assertions.
  • Local strict review: two passes. The first raised the badge sibling, which the second commit fixes, and the second pass came back clean.

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 19, 2026 11:48
…r_review.py

reduced dropped every emphasis tag before any quotation was masked, so a
finding quoting one in code lost it from its own text. It now finds the tags
in a copy with every quotation masked, as unwrap already does for TAGS, and
the two share that drop. normal, unwrap, and heading_count read the same
reduction, so the vetted, printed, and counted text still move together.

Fixes #3215

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r_review.py

The emphasis fix left the badge reduction beside it reading unmasked text, so a
finding quoting a badge in code printed its alt text instead. Both reductions
now go through one quote-aware substitution, which unwrap's tag drop shares.

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

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

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

@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: a07d049f-9707-446f-8814-12e4a5f27705
  • 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

Two moderate findings remain unresolved.

No open issues 🎉

What changed in this PR

Updates review-text reduction to preserve emphasis tags and severity badges inside code quotations.

Changes:

  • Adds shared quote-aware substitution logic.
  • Reuses it for badge and tag handling.
  • Adds regression tests for inline, fenced, mixed, and badge quotations.
File Summary
tests/​test_pr_review.py Adds regression coverage; includes a docstring wording finding.
scripts/​pr_review.py Implements quote-aware reductions; includes a nested-code-span preservation finding.

Review effort: Lite

The test pins quoted badges as well as emphasis tags, and heading_count reads
a count past the quotation rather than keeping it, so the name and docstring
now say both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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.59%. Comparing base (f1e5727) to head (af37f5c).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3234      +/-   ##
===========================================
+ Coverage    65.57%   65.59%   +0.01%     
===========================================
  Files           17       17              
  Lines         9782     9786       +4     
===========================================
+ Hits          6415     6419       +4     
  Misses        3367     3367              
Flag Coverage Δ
python-3.13 65.59% <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.

…he Quotation

normal still rewrites counts and whitespace inside a quotation, so the
docstring claims only the markup it keeps.

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 af37f5c595443388659d58d8aeddfdd3ee231228, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

Answering the round on 5399461, whose headline says "Needs a closer look" while naming no finding beyond its file table:

  • Docstring wording finding (tests/test_pr_review.py): real, fixed in 997d1fa and af37f5c. The test also pins quoted badges, and normal keeps quoted markup but still rewrites counts and whitespace inside a quotation, so the name and docstring now say exactly that.
  • Nested code-span preservation finding (scripts/pr_review.py): no failing input found. A local strict review constructed a <b> c , <b>x</b>, <strong>aand</strong>, `` <b>t</b> ``, an escaped backtick, and a span across a blank line.unwrapprints each as GFM reads it. The one divergence it did find is a pre-existingCODE_SPAN` over-match, a backtick inside an HTML comment or autolink opening a span, filed as Open No Code Span at a Backtick Inside an HTML Comment or Autolink in pr_review.py #3235.

@ptr727
ptr727 merged commit 50b6eb5 into develop Oct 19, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/emphasis-tag-in-code branch October 19, 2026 19:21
ptr727 added a commit that referenced this pull request Oct 19, 2026
…ain (#3238)

## Summary

Promotes two `pr_review.py` and prose gate fixes from develop.

- #3234: an emphasis tag or severity badge a finding quotes in code is
kept in the vetted, printed, and counted text, through one quote-aware
substitution shared with `unwrap`'s tag drop.
- #3237: `pr_review.py` and the prose gate's `prose_lint.py` hold one
list of paragraph-interrupting HTML block names, settled against
GitHub's renderer, with a test holding them equal. The prose gate also
ends a block tag name at block-start whitespace rather than at a word
boundary.

Closes #3215
Closes #3228

🤖 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