Skip to content

Read a Heredoc Whose Delimiter Opens on a Digit in the Prose Gate #3435

Closed

Description

@ptr727

Problem

The prose gate's patched Bash heredoc rule, HEREDOC in .github/actions/prose-gate/prose_lint.py, takes a delimiter that opens on a letter or an underscore. Bash also accepts a delimiter that opens on a digit, and the stock Pygments rule reads it with \w+. A heredoc such as <<123 is therefore not recognized, so its body is lexed as code, and an apostrophe in it opens a single-quoted string that hides every later comment from the comment checks.

main already carried the letter-first delimiter before #3427, so this is pre-existing. The promotion review on #3434 raised it.

Reproduction (constructed)

- run: |
    cat >> "$GITHUB_STEP_SUMMARY" <<123
    The build didn't publish.
    123
    # 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. With the delimiter spelled EOF it reports the comment.

What fixing it needs

A delimiter class that accepts a leading digit, such as \w[\w-]*, with a test that a shift outside the lexer's math state, such as let x=1<<2, still does not open a heredoc.

Activity

  1. added
    pre-existing
    on Oct 24, 2026
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

    pre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions