Skip to content

Read a Run-Block Heredoc Body Without Letting Its Apostrophes Hide Later Comments #3413

Closed

Description

@ptr727

Problem

The prose gate lexes a YAML run: block as bash with its heredoc rule removed, so a heredoc body is read as code and the comments of an inline script inside it stay governed. An apostrophe in such a body opens a bash single-quoted string, which Pygments extends to the next ' anywhere later in the script, and every comment between the two goes unread by comment-wrap, comment-case, comment-added and issue-ref.

Reproduction (constructed)

- run: |
    cat >> "$GITHUB_STEP_SUMMARY" <<EOF
    The build didn't publish.
    EOF
    # retry the upload.
    jq -r '.x' o.json

uv run --no-project --script .github/actions/prose-gate/prose_lint.py --check comment-case x.yml reports nothing, where the comment opens lowercase. The gate before the restructure read run blocks under YAML quote rules and reported it.

What fixing it needs

A run-block heredoc body read as code without its prose able to open a string that outlives the body, for example lexing each heredoc body as its own nested span. No current fleet file shows the pattern in a full comparison of the old and new gates, so this is a latent gap rather than a lost verdict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions