Skip to content

ci(validate): widen shellcheck scope to all tracked shell scripts#766

Merged
kcenon merged 2 commits into
developfrom
ci/issue-764-shellcheck-scope
Jun 18, 2026
Merged

ci(validate): widen shellcheck scope to all tracked shell scripts#766
kcenon merged 2 commits into
developfrom
ci/issue-764-shellcheck-scope

Conversation

@kcenon

@kcenon kcenon commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Closes #764. Part of #758.

Summary

  • Replace the two-glob shellcheck loop in validate-hooks.yml with a self-tracking mapfile -t scripts < <(git ls-files '*.sh') loop at --severity=error -e SC2086 (covers all 176 tracked .sh; new scripts are covered automatically).
  • Keep the existing hook/benchmark globs (global/hooks/*.sh, tests/batch_drift_benchmark/*.sh) at the stricter -S warning bar as a separate loop, sharing the failed gate.
  • Fix the 2 pre-existing error-level findings the wider scope surfaces (real fixes, not suppression):
    • scripts/lib/safe-rm.sh: SC2148 -- add a # shellcheck shell=bash directive (it is a sourced library with no shebang).
    • scripts/memory-sync-issues/tooling/create-issues.sh:64: SC2145 -- <<<"$@$0" -> <<<"$* $0" (the array/string mix is joined on IFS, semantically equivalent for the grep match).

Note on scope

The issue body claimed "0 error-level findings"; local verification with shellcheck 0.11.0 surfaced 2. They are fixed here so the widened error-severity loop actually lands green. Re-verified: 0 errors across all 176 tracked .sh.

Test Plan

  • git ls-files '*.sh' + shellcheck --severity=error -e SC2086 over each -> 0 findings.
  • The hook/benchmark -S warning loop keeps its exact prior command and behavior.

Out of scope

No .shellcheckrc. The follow-up warning-severity ratchet (e.g. SC2164/SC2155) is deferred per the issue.

kcenon added 2 commits June 18, 2026 15:39
Replace the two-glob shellcheck loop with a self-tracking git ls-files '*.sh' loop at error severity, keeping the hook/benchmark globs at the warning bar in a separate loop. Fix the 2 pre-existing error-level findings the wider scope surfaces: SC2148 in safe-rm.sh (sourced-library shell directive) and SC2145 in create-issues.sh (array/string here-string).
…lity

macOS runners default to bash 3.2, which lacks the bash 4+ mapfile builtin. Use a while-read loop over process substitution (not a pipeline) so the failed flag persists in the current shell.
@kcenon kcenon merged commit 527da5c into develop Jun 18, 2026
5 checks passed
@kcenon kcenon deleted the ci/issue-764-shellcheck-scope branch June 18, 2026 22:13
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