Skip to content

fix(hack): make audit-gate lint scripts run on stock macOS - #159

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

fix(hack): make audit-gate lint scripts run on stock macOS#159
omergk28 wants to merge 1 commit into
ActiveMemory:mainfrom
omergk28:fix/hack-script-portability

Conversation

@omergk28

Copy link
Copy Markdown
Contributor

fix(hack): make audit-gate lint scripts run on stock macOS

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

What

make audit could not run at all on a default macOS toolchain
(bash 3.2, BSD grep). Three GNU-isms, three minimal
behavior-preserving fixes:

Script Failure on stock macOS Fix
hack/lint-drift.sh empty-array "${arr[@]}" aborts under set -u (bash 3.2) ${arr[@]+"${arr[@]}"} guard
hack/lint-docstrings.sh apostrophe in a comment inside $( ) breaks bash 3.2's substitution parser reworded comment
hack/lint-docstrings.sh grep -cP is GNU-only; BSD grep returns empty counts → every exported struct false-positives as MISSING_FIELDS $'^\t…' + [[:space:]] (POSIX)

Verification

  • make audit completes green on macOS bash 3.2.57 / BSD grep,
    with identical findings to a GNU toolchain (lint-drift: clean,
    no docstring false-positives).
  • shellcheck clean.

Notes

@omergk28
omergk28 requested a review from josealekhine as a code owner August 20, 2026 02:18
lint-drift.sh aborted on empty-array expansion under set -u
(bash 3.2), lint-docstrings.sh broke bash 3.2's command-substitution
parser with an apostrophe in a comment, then false-positived
MISSING_FIELDS on every exported struct because BSD grep has no
-P/PCRE. make audit could not run at all on a default macOS
toolchain. Behavior-preserving POSIX/bash-3.2-safe substitutions;
findings identical under GNU.

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 e9279d8 to 35c9cc6 Compare August 20, 2026 02:31
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