fix(build): make sa actually fail on shellcheck findings#815
Merged
Conversation
'find -exec shellcheck {} \;' swallows shellcheck's exit code — find returns 0
regardless of findings, so 'make sa' printed warnings yet reported OK and let
them through to CI (which then failed on SC1087/SC2034 that the local gate had
'passed'). Run one file per invocation via xargs, which propagates failures;
-P 4 keeps it ~6s. The excludes mirror CI's SHELLCHECK_OPTS so both gates
check the same thing. One file per invocation also sidesteps a shellcheck
0.11.0 crash (GHC pattern-match failure) on multi-file batches with -x.
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.
🤔 Background
make sausedfind -exec shellcheck {} \;, andfindswallows the command's exit code — the target printed findings yet always reported OK. Real findings (SC1087/SC2034 in #813) sailed through the local gate and only failed in CI.💡 Changes
xargs -n 1 -P 4, which propagates failures (verified: a bad probe file now fails the target; clean tree passes in ~6s).SHELLCHECK_OPTSexcludes so the local and CI gates check the same thing.-x.