Visitar URL original
Read a Markdown Code Span as Quoted Data and Pass a Semicolon Inside One Token by ptr727 · Pull Request #4136 · ptr727/ProjectTemplate · GitHub
Skip to content

Read a Markdown Code Span as Quoted Data and Pass a Semicolon Inside One Token - #4136

Merged
ptr727 merged 8 commits into
developfrom
burndown/prose-charset-code-span
Nov 13, 2026
Merged

ptr727 merged 8 commits into
developfrom
burndown/prose-charset-code-span

Conversation

@ptr727

@ptr727 ptr727 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • The prose gate's charset and charset-unknown rules now read a Markdown inline code span as quoted data, the way they already read a fenced block. This applies the maintainer's recorded answer on Let the Prose Gate's Charset Rules Admit a String Quoted Verbatim From an External Source #4058, the first direction, with no new tier or marker. A string quoted verbatim from another source keeps its bytes inside the sentence it sits in.
  • Code spans are paired as Markdown pairs them, through a new spanless unit built from markdown-it-py's inline tokens with the existing span-aware MARKDOWN_SPAN pattern. So a span wrapped across a line break, a double-backtick span, and an escaped backtick are each read correctly. Code-file lines, Markdown front matter, and HTML block lines are read whole.
  • The semicolon, dash, dupword, spelling, and sentence-split rules read a codeless unit, paired the same way, instead of pairing backticks one line at a time, which hid the prose after a wrapped span. On front matter and HTML block lines, which no inline token holds, that unit still empties a span one line at a time. strip_inline_code now delegates to the same blank_code_spans primitive, and a span empties to its backticks so a label holding one still counts it as one word.
  • The semicolon rule no longer reports a semicolon with a word character on both sides, such as the one inside TL;DR. An HTML entity's closing semicolon is still reported.
  • The comment-and-doc-style skill's "Character set" section, scripts/README.md, and the gate's semicolon summary in prose-gate.json state both exceptions. The generated skill copies are regenerated with scripts/build_dist.py.

Tests

New cases in tests/test_prose_lint.py each failed against the gate before the change that fixes it:

  • an unclassified character, a tier-2 operator with no figure beside it, and a tier-1 dash each pass inside a code span and inside a fence, and still flag outside one
  • a wrapped span, a double-backtick span, and an escaped backtick hide only the span's own text
  • a code span in a table cell is emptied within its cell, a row is emptied once so text between two spans is read, and front matter, an HTML block, and a shell comment are read whole by charset
  • front matter and an HTML block still hide a span from the semicolon and dash rules, and a span in a three-word label keeps the labeled pair's exemption
  • dupword, spelling, and sentence-split read the text after a wrapped, double-backtick, or escaped span, and a span wrapped inside a blockquote keeps its quote marker
  • TL;DR passes, an HTML entity's semicolon and a spaced splice still flag, and a wrapped span hides no semicolon or dash after it

Pre-existing findings, filed

Declined findings

  • introduced: sentence-split no longer reports a line whose next line opens inside a code span wrapped across the break. The rule judges whether the next prose line opens in lowercase, and a span's text is code rather than prose. On develop a span opening its line was already read as backticks and never as lowercase, so the old report came only from the unpaired closer. test_a_wrapped_code_span_continues_no_prose_line pins the behavior.

  • pre-existing: the charset-unknown summary in prose-gate.json, OPERATIONS.md "Local Verification", and the charset-unknown paragraph of scripts/README.md name a Latin letter as the only unreported character in no tier. Each describes the characters the rule reads, and a fenced block was already outside that read without being named there, so the code span joins an exclusion those statements never enumerated.

Closes on promotion: #4058, #3954

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 12, 2026 21:32
…One Token

The charset rules now blank a Markdown inline code span before judging a
line, as they already skip a fenced block, so a string quoted verbatim
from another source keeps its bytes. A code line is still read whole.

The semicolon rule no longer reports a semicolon with a word character on
both sides, such as the one in TL;DR, since it joins no clause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pairing backticks one line at a time took a wrapped span's closer for an
opener and hid the prose up to the next span. The charset rules now read
a spanless unit, built from markdown-it-py's inline tokens with the
span-aware MARKDOWN_SPAN pattern, so front matter and an HTML block are
read whole as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The semicolon, dash, dupword, spelling, and sentence-split rules paired
backticks one line at a time, so a wrapped code span hid the prose after
it. They now read the spanless unit the charset rules read. The joined
semicolon pattern no longer passes an HTML entity's closing semicolon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 13, 2026 05:57
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Nov 13, 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 13 seconds.

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

Commits

Reviewing files that changed from the base of the PR and between 025da5c and b64b7be.

Files ignored due to path filters: 3

  • .claude-plugin/fleet-skills/.source-digests/comment-and-doc-style is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/comment-and-doc-style/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .github/skills/comment-and-doc-style/SKILL.md is excluded by !.github/skills/**
Files selected for processing: 5

  • .agents/skills/comment-and-doc-style/SKILL.md
  • .github/actions/prose-gate/prose-gate.json
  • .github/actions/prose-gate/prose_lint.py
  • scripts/README.md
  • tests/test_prose_lint.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

The spanless unit reads front matter and an HTML block whole, as the
charset rules should. The semicolon, dash, dupword, spelling, and
sentence-split rules read a codeless unit instead, which still blanks a
span on those lines one line at a time as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

A moderate regression causes literal backtick content in front matter and HTML blocks to trigger unrelated prose rules, and the change lacks coverage for key span-pairing paths.

3 open issues
What changed in this PR

This pull request updates the prose gate to treat Markdown inline code spans as quoted data, improves semicolon handling, and synchronizes related documentation, tests, and generated skill distributions.

Changes:

  • Adds Markdown-aware span masking for wrapped, escaped, and multi-backtick code spans.
  • Applies the shared spanless unit to charset and other prose rules.
  • Allows semicolons inside single tokens and updates regression tests, documentation, generated skills, and the source digest.
File Description
tests/​test_prose_lint.py Adds regression coverage for Markdown code spans, Markdown contexts, and semicolon behavior.
scripts/​README.md Documents inline code-span handling and semicolon exceptions.
.github/​skills/​comment-and-doc-style/​SKILL.md Updates the generated GitHub skill guidance for quoted code spans and semicolon handling.
.github/​actions/​prose-gate/​prose-gate.json Updates the prose gate's semicolon rule summary.
.github/​actions/​prose-gate/​prose_lint.py Implements span-aware Markdown masking and revised prose-rule and semicolon behavior.
.claude-plugin/​fleet-skills/​skills/​comment-and-doc-style/​SKILL.md Regenerates the Claude skill distribution with the updated guidance.
.claude-plugin/​fleet-skills/​.source-digests/​comment-and-doc-style Updates the source digest for the generated skill content.
.agents/​skills/​comment-and-doc-style/​SKILL.md Updates the authored skill guidance for code spans and semicolon handling.

Review effort: Lite

Comment thread tests/test_prose_lint.py Resolved
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.70%. Comparing base (fa06887) to head (b64b7be).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4136      +/-   ##
===========================================
+ Coverage    76.69%   76.70%   +0.01%     
===========================================
  Files           40       40              
  Lines        14146    14148       +2     
===========================================
+ Hits         10849    10852       +3     
+ Misses        3297     3296       -1     
Flag Coverage Δ
python-3.13 76.70% <ø> (+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.

strip_inline_code now empties a span through blank_code_spans, so front
matter, an HTML block, and a comment pair a backtick run and an escape as
Markdown does. The spanless and codeless units drop a span's content
rather than spacing it, so a span in a label counts as one word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

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

ptr727 and others added 2 commits November 12, 2026 22:17
Each cell's inline token maps its whole row, and emptying a span is not
idempotent, so a row emptied once per cell lost the text between two
spans. A row is now emptied once. New cases cover dupword, spelling, and
sentence-split after a wrapped, double-backtick, or escaped span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A span wrapped across blockquote lines took the next line's quote marker
as span content, so sentence-split read the quoted line as prose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 13, 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.

@ptr727
ptr727 merged commit 9ed10c1 into develop Nov 13, 2026
13 checks passed
@ptr727
ptr727 deleted the burndown/prose-charset-code-span branch November 13, 2026 06:50
ptr727 added a commit that referenced this pull request Nov 13, 2026
… Rules (#4189)

## Summary

Promotes the backlog-burndown rounds and changes from other hub sessions
from `develop` to `main`.

- Hooks and the prose gate: #4132, #4134, #4136, #4145, #4152, #4184.
The Husky hook reads its path list once and diffs a merge against
`MERGE_HEAD`. Interrupts re-raise their signal, a Markdown code span
reads as quoted data, and the gate picks a commit's diff base and
recognizes a conflicted promotion's branch cut from `main`.
- Procedures and carried rules: #4133, #4139, #4141, #4149, #4166,
#4177, #4179, #4183, #4185. Resync, audit and check-this-repo procedure
gaps, code style and shell interrupt rules, review-loop gaps across four
skills, the context and delegation section of `AGENTS.md`, question
rules in governance, the promotion line in pull request bodies,
closing-keyword behavior on promotion, and the history-rewrite premise.
- Review and cleanup tooling: #4138, #4148, #4154, #4156, #4157, #4163,
#4164, #4168, #4174, #4180. Cleanliness reads, parked handoffs, the
backlog report's JSON output, exact inline script pins, trusted inputs,
env-file includes, the bounded review wait, side-reviewer matching, and
a Copilot billing-failure notice read as a refusal.
- Workflow and runbook contract: #4153, #4155, #4169, #4171, #4178,
#4182. The runtime-secrets check, a registry entry and spec references,
the Copilot runbook pointers, credential-free checkout steps, and the
deploy-key and runner wording.
- From other hub sessions: #4159 (a repository's own .NET line under a
fleet default), #4161 (the 1Password CLI as an optional host tool),
#4162 (Codex's Windows installer and one managed opencode copy). These
carry no promotion line.

#4182 carries no promotion line by design, and #4175 holds the split-out
part of #4057's scope. Both #1448 and #4175 stay open.

Fixes #1071
Fixes #1154
Fixes #1391
Fixes #1471
Fixes #1594
Fixes #1620
Fixes #1627
Fixes #1650
Fixes #1801
Fixes #2853
Fixes #3620
Fixes #3668
Fixes #3697
Fixes #3766
Fixes #3787
Fixes #3837
Fixes #3840
Fixes #3842
Fixes #3844
Fixes #3865
Fixes #3882
Fixes #3890
Fixes #3894
Fixes #3912
Fixes #3916
Fixes #3954
Fixes #4014
Fixes #4015
Fixes #4016
Fixes #4043
Fixes #4050
Fixes #4057
Fixes #4058
Fixes #4062
Fixes #4084
Fixes #4097
Fixes #4098
Fixes #4099
Fixes #4104
Fixes #4108
Fixes #4114
Fixes #4115
Fixes #4117
Fixes #4118
Fixes #4119
Fixes #4121
Fixes #4122
Fixes #4123
Fixes #4131
Fixes #4135
Fixes #4140
Fixes #4142
Fixes #4143
Fixes #4144
Fixes #4151

🤖 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