Skip to content

fix(hack): guard empty-array expansion in lint-drift.sh for bash 3.2 - #159

Open
omergk28 wants to merge 1 commit into
ActiveMemory:mainfrom
omergk28:fix/hack-script-portability
Open

fix(hack): guard empty-array expansion in lint-drift.sh for bash 3.2#159
omergk28 wants to merge 1 commit into
ActiveMemory:mainfrom
omergk28:fix/hack-script-portability

Conversation

@omergk28

@omergk28 omergk28 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

fix(hack): guard empty-array expansion in lint-drift.sh for bash 3.2

Branch: fix/hack-script-portabilitymain
Commits: e6a875cd · Spec: specs/hack-script-portability.md

Rescoped after #163 merged. The Codex integration PR
independently fixed the two lint-docstrings.sh portability bugs
this PR originally carried (see
specs/lint-docstrings-macos-portability.md). Rebased onto main
and slimmed to the one fix that is still needed.

What

make audit could not run at all on a default macOS toolchain:

Script Failure on stock macOS Fix
hack/lint-drift.sh empty-array "${arr[@]}" aborts under set -u (bash 3.2: "unbound variable"; legal since bash 4.4) ${arr[@]+"${arr[@]}"} guard

Verification

  • make audit completes green on macOS with identical findings to a
    GNU toolchain (lint-drift: clean).
  • shellcheck clean.

Notes

🤖 Generated with Claude Code

@omergk28
omergk28 requested a review from josealekhine as a code owner August 20, 2026 02:18
@omergk28
omergk28 force-pushed the fix/hack-script-portability branch from e9279d8 to 35c9cc6 Compare August 20, 2026 02:31
lint-drift.sh aborted with "exclude_args[@]: unbound variable" under
set -u on stock macOS /bin/bash 3.2, which treats expanding an empty
array as an unset-variable error (legal since bash 4.4). make audit
could not run at all on a default macOS toolchain. Behavior-preserving
${arr[@]+"${arr[@]}"} guard; findings identical under GNU.

The sibling lint-docstrings.sh portability bugs were fixed upstream
(specs/lint-docstrings-macos-portability.md, PR ActiveMemory#163); this branch
now carries only the lint-drift fix.

Spec: specs/hack-script-portability.md
Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
@omergk28
omergk28 force-pushed the fix/hack-script-portability branch from 35c9cc6 to e6a875c Compare August 28, 2026 16:26
@omergk28 omergk28 changed the title fix(hack): make audit-gate lint scripts run on stock macOS fix(hack): guard empty-array expansion in lint-drift.sh for bash 3.2 Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant