Repository navigation
Lex Heredoc Bodies Apart and Skip Code Spans When Numbering Inline Comments - #3427
Conversation
…mments A run block's heredoc body is lexed as its own span, so an apostrophe in its prose cannot open a string that hides later comments. An inline Markdown comment search now advances past each code span, so a span holding the comment's text is never where the comment is found. The size ceiling moves from 1800 to 1840 lines for the added splitter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Spans by First Word Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ly Code Spans Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟡 Changes recommended
Two unresolved moderate findings in .github/actions/prose-gate/prose_lint.py affect heredoc detection and inline comment discovery.
2 open issues
What changed in this PR
This pull request improves prose-gate parsing for heredocs in YAML run: blocks and Markdown inline code spans, preserving accurate comment detection and line numbers.
Changes:
- Splits heredoc bodies into independently lexed spans with preserved line offsets.
- Advances inline-comment searches past code spans.
- Adds regression tests and raises the splitter size ceiling from 1800 to 1850 lines.
| File | Summary |
|---|---|
tests/test_prose_lint.py |
Adds regression coverage for heredoc apostrophes, comment numbering, inline code spans, line offsets, and the updated size ceiling. |
.github/actions/prose-gate/prose_lint.py |
Implements heredoc splitting and code-span-aware inline comment positioning. Two unresolved moderate findings remain: single-quoted strings can be misidentified as heredoc contexts, and a repeated one-word code span can cause a subsequent HTML comment to be missed. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3427 +/- ##
========================================
Coverage 80.81% 80.81%
========================================
Files 23 23
Lines 8859 8863 +4
========================================
+ Hits 7159 7163 +4
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:
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Headline 'unresolved moderate heredoc parsing issues' disposition: the covering table is carried from 7aa574c and its two threads are answered (one fixed in 7db26c6, one declined with a reproduction). The remaining heredoc shapes (hyphenated delimiter, two heredocs on one opener line, loose terminator indentation, a heredoc opened inside a double-quoted command substitution) are listed in the description as known gaps that leave behavior no worse than before this change. |
…ng Inline Comments Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
…xes to Main (#3434) ## Summary Promotes the pull requests merged into develop since release 2.0.1158. - [#3422](#3422): `drive-pr` and `backlog-burndown` have every draft of a pull request body go in a file named for its repository and branch. Two lanes sharing one `pr-body.md` had published each other's drafts. - [#3423](#3423): in `pr_review.py`, an earlier partial round outranks a head round reading `unknown`, printing `coverage=PARTIAL` and exiting 42. - [#3427](#3427): the prose gate takes run-block heredoc bodies from its patched Bash lexer's heredoc tokens and lexes each alone, so an apostrophe in a body no longer hides later comments. Inline Markdown comments are numbered with code spans masked. The gate's size ceiling moves from 1800 to 1840 lines, as the maintainer decided on that pull request. Two edge cases are deferred to #3429 and #3430, and a pre-existing one is filed as #3428. - [#3431](#3431): deletes `spec/carried_text.py` and reads carried Markdown regions through markdown-it-py in the new `spec/fidelity_text.py`. `carry.py`, `build_dist.py`, and `canonical_review.py` carry PEP 723 metadata, and every caller runs them as `uv run --no-project --script`. The full audit sweep is identical before and after. The `validate.py` remainder is #3426, and a pre-existing include-marker gap is #3432. - [#3433](#3433): `pr-review-conduct` and `scripts/README.md` say exactly when the earlier-partial path exits 42, following #3423. Closes #3412 Closes #3413 Closes #3414 Closes #3425 ## 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 | | --- | --- | --- | | [#3422](#3422) | `b645b429` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | | [#3423](#3423) | `3f893b65` | attested local pass, and a carried Copilot table, `coverage=carried:table` | | [#3427](#3427) | `2511b62b` | attested local pass, and a carried Copilot table, `coverage=carried:table` | | [#3431](#3431) | `92755285` | attested local pass, `coverage=local` | | [#3433](#3433) | `cceba3af` | attested local pass, `coverage=local` | 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Takes each run-block heredoc body from the shell-state-aware Bash lexer on the de-indented script, then lexes each body on its own, so an apostrophe in its prose cannot open a string that outlives it. The hyphenated delimiter
<<END-OF-TEXTand an indentedEOFline inside a body now work as a side effect. Numbers an inline Markdown comment on lines with code spans blanked, so a span holding the comment's text is never where the comment is found. Raises the gate's size ceiling from 1800 to 1840 lines (the gate is 1839, 39 over the old ceiling), for the maintainer to decide.Closes on promotion: #3413
Closes on promotion: #3414
Pre-existing findings, filed:
<<A 3<<B) is still read as code.Introduced findings from the final local review, deferred to filed issues:
run:step, so a shift by a name plus a multi-line string can misread comments.This change writes comment lines, so it carries the
commentslabel.🤖 Generated with Claude Code