ci(validate): widen shellcheck scope to all tracked shell scripts#766
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #764. Part of #758.
Summary
validate-hooks.ymlwith a self-trackingmapfile -t scripts < <(git ls-files '*.sh')loop at--severity=error -e SC2086(covers all 176 tracked.sh; new scripts are covered automatically).global/hooks/*.sh,tests/batch_drift_benchmark/*.sh) at the stricter-S warningbar as a separate loop, sharing thefailedgate.scripts/lib/safe-rm.sh:SC2148-- add a# shellcheck shell=bashdirective (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 thegrepmatch).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 SC2086over each -> 0 findings.-S warningloop 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.