Skip to content

Stop the Prose Gate Reading a Bash Parameter Expansion as a Comment - #1830

Merged
ptr727 merged 1 commit into
developfrom
feature/auto-1646
Sep 25, 2026
Merged

ptr727 merged 1 commit into
developfrom
feature/auto-1646

Conversation

@ptr727

@ptr727 ptr727 commented Sep 25, 2026

Copy link
Copy Markdown
Owner

extracted_comments in the prose gate read the # inside a bash parameter expansion such as ${#items[@]} as a comment opener, so a run: line counting an array was judged as prose, and an echo string holding one failed comment-wrap.

A # right after $ or ${ is now skipped as a line comment marker, read off the raw line so an escaped $ still counts. A real leading or trailing comment on the same line is still extracted. The wider parser carry work for string and heredoc content stays with #1664.

A regression test covers both spellings from the issue, $#, the gate's own verdict on the echo line, and the still-extracted leading and trailing comments. It fails with the fix reverted.

Closes on promotion: #1646

🤖 Generated with Claude Code

`extracted_comments` in the prose gate read the `#` inside a bash
parameter expansion such as `${#items[@]}` as a comment opener, so a
`run:` line counting an array was judged as prose, and an `echo`
string holding one failed `comment-wrap`.

A `#` right after `$` or `${` is now skipped as a line comment marker,
read off the raw line so an escaped `$` still counts. A real leading or
trailing comment on the same line is still extracted. The wider parser
carry work for string and heredoc content stays with #1664.

A regression test covers both spellings from the issue, `$#`, the
gate's own verdict on the `echo` line, and the still-extracted leading
and trailing comments. It fails with the fix reverted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 25, 2026 20:26
@coderabbitai

coderabbitai Bot commented Sep 25, 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: 461a0f2d-b2b4-4414-8d3b-bc4e6408a7f5


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.

Copilot review overview

🟢 Approval recommended

The change is narrowly scoped, matches the stated bug, and includes a regression test covering the reported cases and expected remaining behavior.

Review effort: Lite
Findings: None

What changed in this PR

This pull request updates the prose gate’s comment extractor to avoid misclassifying Bash parameter expansions (for example ${#items[@]} and $#) as # line comments, which previously caused false prose-rule failures on shell code embedded in workflow run: blocks.

Changes:

  • Add line_marker() to locate # line comment markers while skipping the # used in Bash parameter counting expansions.
  • Wire extracted_comments() to use line_marker() for line-comment detection.
  • Add a regression test covering ${#items[@]}, $#, and validation that real trailing/leading # comments are still extracted.
File Description
.github/​actions/​prose-gate/​prose_lint.py Teach comment extraction to ignore # immediately following $ / ${ so Bash parameter expansions are not treated as comments.
scripts/​tests/​test_prose_lint.py Add regression coverage ensuring the extractor and rule pipeline no longer flags Bash array-count expansions as prose comments.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727
ptr727 merged commit 43da19b into develop Sep 25, 2026
9 checks passed
@ptr727
ptr727 deleted the feature/auto-1646 branch September 25, 2026 20:29
ptr727 added a commit that referenced this pull request Sep 26, 2026
… Fixes to Main (#1839)

Promotes `develop` to `main`.

## Carried

- #1830: stops the prose gate reading a `#` after `$` or `${` as a
comment marker, per #1646.
- #1832: corrects the comment on the `pr_review.py` quota-refusal
remedy, per #1647.
- #1834: accepts an absent, empty, or wildcard SessionEnd matcher as
covering every exit reason, per #1638.
- #1838: routes every question and every offer of more work through the
interface's prompt mechanism, blocking or not.
- #1841: describes a SessionEnd matcher by its shape in the installer
report, following #1834.

Closes #1646
Closes #1647
Closes #1638

🤖 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