From 825099c4bb8f132555221ef4789ccd3a7c78d2f6 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:59:36 -0800 Subject: [PATCH] fix(ci): the shell check lists only tracked files `sh/shell.sh` walked the whole tree with `shfmt -f .` and kept the tracked results. A concurrent `bun install` creating and removing a temporary directory under an untracked `node_modules` stopped the walk early, and the process substitution hid shfmt's failure, so the check linted a partial set. Without `test/lib/harness.sh` in it, shellcheck flagged `bench/browser/run.sh` and the merge queue dropped an unrelated PR. Ask shfmt about `git ls-files` instead, and fail if the listing fails. Co-Authored-By: Claude Opus 5.5 --- sh/shell.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sh/shell.sh b/sh/shell.sh index fb6ae022c8b..72f9f251fbb 100755 --- a/sh/shell.sh +++ b/sh/shell.sh @@ -4,12 +4,23 @@ set -euo pipefail cd "$(git rev-parse --show-toplevel)" -scripts=() +# Ask shfmt about tracked files only: walking the tree races any tool creating and removing +# untracked directories, such as a concurrent `bun install` under node_modules. +tracked=() while IFS= read -r -d '' file; do - if git --literal-pathspecs ls-files --error-unmatch -- "$file" >/dev/null 2>&1; then - scripts+=("$file") + # Skip a tracked file deleted from the worktree. + if [[ -f $file ]]; then + tracked+=("$file") fi -done < <(shfmt -f=0 .) +done < <(git ls-files -z) +((${#tracked[@]})) || exit 0 + +scripts=() +while IFS= read -r -d '' file; do + scripts+=("$file") +done < <(shfmt -f=0 -- "${tracked[@]}") +# A failed listing would lint a partial set and pass or fail on the wrong files. +wait "$!" ((${#scripts[@]})) || exit 0 case "${1:-}" in