Skip to content

test(bash32): unify the two heredoc-in-substitution scanners after #644 and #653 merge #665

Open

Description

@mogul

🤖: AI agent (First Mate), AI-assisted; human review required.

Problem

Two open pull requests each add a scanner for the same bash 3.2 hazard: a here-document inside $( ) or <( ) whose body has odd quotes, an unpaired backtick or unbalanced parentheses. Bash 3.2 fails at parse time on such a body; bash 4+ accepts it.

Both flag the real failure that reached CI (the commit where a Python comment containing an apostrophe, backticks and parentheses broke the facts reader under bash 3.2). Both pass on the fixed file and on current main. Neither is a real parser; bash-3.2 -n is the authority. Having two copies means the rules will drift.

Proposed change

Keep scripts/scan-heredoc-subst.py as the single scanner (it is the superset). Point test 151 at it, delete test/bats/heredoc-scan.py, and keep test 151's positive and negative cases so coverage does not drop. The decision record added with #653 already says to fold the two into one file.

Trigger

Blocked until both #644 and #653 are merged to main. Pick this up after the second of the two merges.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions