Repository navigation
Lex Each of Two Heredoc Bodies Alone and Keep Autolinks Out of the Code-Span Mask - #3439
Conversation
…de-Span Mask The run-block heredoc split cuts a token holding two bodies at the first terminator, so an apostrophe in the first body cannot open a string through a comment in the second. The inline comment mask lets a URI autolink take its backticks, the one stray-backtick form #3429 names that the previous change left out. Three single-use assignments become walrus conditions, which keeps the gate at its 1862-line ceiling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The autolink alternative copies AUTOLINK_RE's character classes, a scheme of ASCII letters, digits, `+`, `.`, and `-`, and a target excluding control characters and the space, rather than an approximation of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain, and focused regression coverage is included.
No open issues 🎉
What changed in this PR
This pull request fixes two prose-gate parsing gaps: independently lexing multiple heredoc bodies and excluding URI autolinks from Markdown code-span masking.
Changes:
- Splits heredoc tokens at the first terminator so each body is lexed independently.
- Masks URI autolinks as non-code Markdown spans.
- Adds regression tests and simplifies three single-use assignments with walrus conditions.
| File | Description |
|---|---|
tests/test_prose_lint.py |
Adds regression coverage for independent heredoc lexing and URI autolinks. |
.github/actions/prose-gate/prose_lint.py |
Updates heredoc splitting, Markdown span masking, and assignment style. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3439 +/- ##
========================================
Coverage 80.76% 80.76%
========================================
Files 23 23
Lines 8839 8839
========================================
Hits 7139 7139
Misses 1700 1700
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:
|
…ktick Fixes to Main (#3438) ## Summary Promotes the pull requests merged into develop since release 2.0.1163. - [#3437](#3437): the prose gate reads a heredoc label opening on a digit where its terminator line follows, queues a second heredoc on one opener line, skips the run-block heredoc split for a step whose `shell:` is neither bash nor sh, and numbers inline Markdown comments with escapes, HTML comments, and tags taking their backticks as CommonMark reads them, using markdown-it-py's own tag grammar. The gate's size ceiling moves from 1840 to 1862 lines, as the maintainer decided this round. - [#3439](#3439): fixes the two findings this promotion's review raised. Each of two heredoc bodies on one opener line is lexed alone, and a URI autolink keeps its backticks out of the code-span mask, using markdown-it-py's own autolink character classes. Three walrus rewrites hold the gate at the 1862-line ceiling. - [#3440](#3440): rewords the comment above `HEREDOC` to say the last, unclosed branch is the one that drops a digit label, after this promotion's review read that branch as the second-opener conditional's else branch a second time. Closes #3428 Closes #3429 Closes #3430 Closes #3435 ## Constituent coverage Each change this promotion carries had coverage on its own pull request into develop, at its merged head: | Pull request | Merged head | Coverage | | --- | --- | --- | | [#3437](#3437) | `2e271e22` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | | [#3440](#3440) | `7bbd7780` | attested local pass, and a Copilot table naming exactly the changed file, `coverage=table` | | [#3439](#3439) | `a53ee15a` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fixes the two findings the promotion review raised on #3438, each with a test that fails before and passes after.
split_heredocstook one span per heredoc token, and since Read Digit-Labelled and Second Heredocs, Skip Non-Shell Run Splits, and Pair Backticks as CommonMark Does #3437 a token can hold two bodies (<<A 3<<B), so an apostrophe in the first body could pair with a quote in the second and hide the second body's comment. An empty group after the first terminator, numbered after every existing group so no backreference moves, marks where the split cuts the token.AUTOLINK_REcharacter classes. markdown-it'svalidateLinkrejection of protocols such asfile:is a call rather than a pattern, so a rejected-protocol autolink and an email autolink are not covered, both declined as needing a backtick in the link plus two identical comments to misnumber one.Refs #3428, #3429
🤖 Generated with Claude Code