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
prose_lint reads a bash ${#array[@]} as a comment opener #1646
prose_lint.py's comment extractor reads a bash parameter expansion as the start of a comment, so a shell line inside a workflow run: block is judged as prose it is not.
Repro
importsys; sys.path.insert(0, ".github/actions/prose-gate")
frompathlibimportPathimportprose_lintasplprint(pl.extracted_comments(Path("x.yml"), [' count=${#items[@]}']))
print(pl.extracted_comments(Path("x.yml"), [' echo "::error::${#items[@]} open issues. Close them by hand."']))
Both return a comment body beginning items[@]}, because the extractor treats the # inside ${#...} as a comment opener. The second then fails comment-wrap with "two sentences on one comment line", against an echo string that is not a comment at all.
The quoted form, [ "${#items[@]}" -gt 1 ], returns no comment, so the false positive depends on where the expansion sits rather than on it being there. That makes the rule's answer inconsistent across two spellings of one construct.
Why it matters
Every .github/workflows/*.yml in this repository carries bash in a run: block, and counting an array is ordinary bash. The failure is a gate reporting a violation in text it has no business reading, and the workaround, avoiding the construct, is the gate deciding the code rather than the prose.
Scope
comment-case reads the same extraction, so it has the same exposure. The fix belongs in extracted_comments, which needs to skip a # that opens a parameter expansion, and to know it is inside a quoted string.
Found by
The local review pass on the branch adding .github/workflows/canonical-review-sweep.yml, which hit it on an echo line and worked around it rather than fixing the gate.
Activity
Sweep the Carried-Content Read Weekly Instead of Gating Every Push (#…
Promote the Weekly Carried-Content Sweep to Main (#1654)
Stop the Prose Gate Reading a Bash Parameter Expansion as a Comment (#…