Skip to content

Prose Gate Reads a Data Heredoc After a Shift by a Name as Code #3664

Closed as not planned

Description

@ptr727

The prose gate reads a data heredoc in a workflow run: step as code when a shift by a name comes earlier in the same step. So a # line the heredoc writes into a file is reported as a comment, comment-added included.

Constructed input, x.yml:

- run: |
    (( y = x << n ))
    cat > f <<'EOF'
    # Data the step writes into the file.
    EOF

The gate reports line 4 as a comment line. It should read it as data, the way it reads the same heredoc with no shift before it.

The cause is in split_heredocs. The patched bash lexer reads << n as a heredoc opener that never closes. Since such an opener is more often a shift, the rest of the step stays one code piece. That piece is lexed by bash-heredoc-as-code, which has no heredoc rule, so any later heredoc in it is never split out.

develop before the #1664 fix behaves the same way, since it read every run-block heredoc body as code. Found by the local review pass on the #1664 pull request.

Activity

  1. added
    gate
    pre-existing
    script
    on Oct 30, 2026
  2. ptr727 commented on Oct 30, 2026

    @ptr727
    OwnerAuthor

    Closed as not planned. The answer on #3666 overtakes this issue. The prose gate keeps reading every workflow run: heredoc body as code, as develop does, so this issue's expected reading as data no longer applies, and a shift before a heredoc changes nothing under that reading. #1664's run-block heredoc shape is recorded as an accepted false positive that the comments label clears, in #3665.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gatepre-existingscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions