You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read a Heredoc Whose Delimiter Opens on a Digit in the Prose Gate #3435
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
Read Digit-Labelled and Second Heredocs, Skip Non-Shell Run Splits, a…