feat(shellcheck): support tracked extensionless inputs - #114
Conversation
|
Claude finished @kyle-sexton's task in 0s —— View job I'll analyze this and get back to you. |
|
Claude finished @kyle-sexton's task in 0s —— View job I'll analyze this and get back to you. |
|
Claude finished @kyle-sexton's task in 4m 32s —— View job PR #114 Review: feat(shellcheck): support tracked extensionless inputsTasks:
SecurityInjection safety — clean. All five inputs arrive via
CorrectnessStatus aggregation — safe under ((extra_status <= status)) || status=$extra_statusWhen
git_files=()
mapfile -d '' -t git_files <"$output"Bash cannot return arrays from functions, so storing to a callee-visible global is the right approach. The failure path (
for substring in $exclude; doWord-splitting is intentional (the Overlap deduplication — correct. The Empty-array guards — idiomatic. The Test CoverageThe 24-case suite in Minor gap — split-lane failure: The test at line 177 uses a single Minor gap — CRLF stripping: action.yml
ci.ymlThe new test step is cleanly appended to the existing README.mdThe two-sentence addition at lines 49–51 is accurate and consistent with the SummaryThis is a well-designed feature. The security model is sound: the git-tracked discovery boundary prevents untracked/ignored files from entering the extra lane even when Two actionable items above the fold: the pre-existing |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6fb9fa516
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| read -r -a path_roots <<<"$paths" | ||
| mapfile -d '' -t normal_files < <( | ||
| find "${path_roots[@]}" -type f \( -name '*.sh' -o -name '*.bash' \) \ | ||
| -not -path '*/.git/*' -print0 | sort -z |
There was a problem hiding this comment.
Preserve glob expansion for explicit paths
When a caller sets explicit paths to a globbed root such as packages/*, this quoted array passes the * literally to find; the previous inline action used find $PATHS, so the shell expanded those roots before find ran. Because the resulting find: ... No such file or directory happens inside the process substitution, mapfile still succeeds and the lane can continue with those scripts omitted, weakening ShellCheck coverage for consumers that already rely on globbed roots. Either preserve the old expansion semantics deliberately or fail when a supplied root matches nothing.
Useful? React with 👍 / 👎.
Summary
extra-globsGit pathspecs for tracked extensionless shell inputsextra-exclude-codes, applied only to the extra lane through a separate ShellCheck invocationCloses #64.
Why
The action previously discovered only tracked
*.shand*.bashfiles, so extensionless sourced Bash files required a second consumer-owned CI invocation. ShellCheck accepts explicit file arguments independently of filename extension, while Git's NUL-delimited tracked-file output supplies a safe discovery boundary for caller-provided pathspecs.The design follows the official ShellCheck command contract,
git ls-filespathspec and-zbehavior, and GitHub composite-action input guidance.Compatibility and scope
*.sh/*.bash.pathsretain their existing raw-filesystem behavior.Validation
node --test .github/scripts/*.test.cjs— 234/234 passingbash .github/actions/shellcheck/run.test.sh— 24/24 passinggit diff --checkdot_bash*extras with scopedSC1090,SC1091, exit 0main