Found by:claude-jitfields-to-fastfields.
The lint (clang-format, changed lines) job in .github/workflows/ci.yml can never show what it objects to. Every failure renders as a bare exit code 1, which makes an advisory job useless as advice.
Cause
The step runs under set -euo pipefail and captures the diff into a variable:
set -euo pipefail
base=$(git merge-base "origin/${BASE_REF}" HEAD)
out=$(git-clang-format-18 --binary clang-format-18 --diff \ --extensions h,hpp,inl,cpp,cu,cuh "${base}")case"$out"in"no modified files to format"|"clang-format did not modify any files")
echo"clang-format: changed lines are clean" ;;
*)
echo"$out"# <-- unreachableecho"::error::clang-format would reformat the lines above."echo"Run: git clang-format $base"exit 1 ;;
esacgit-clang-format --diffexits 1 whenever it would reformat something — that is its documented contract, not an error. Under set -e, a failing command substitution in an assignment aborts the shell at that line, so the script dies before reaching case. The entire reporting branch — the diff, the ::error:: annotation, and the "Run: git clang-format …" hint — is dead code in exactly the situation it exists for.
The clean path works, which is why this went unnoticed: a passing run reaches case normally.
Fix
Stop treating exit 1 as fatal for that one command, e.g.
out=$(git-clang-format-18 --binary clang-format-18 --diff \ --extensions h,hpp,inl,cpp,cu,cuh "${base}")||trueor capture the status explicitly and branch on it. Worth also asserting in a test PR that the diff genuinely appears in the log, rather than assuming the fix works.
Why it matters more than it looks
The job is deliberately continue-on-error: true — the comment above it explains that .clang-format postdates the tree, which is hand-column-aligned in many places, so only changed lines are checked and the one-shot reformat is left as its own reviewable change. That design only works if a contributor can see the proposed reformat and judge it. Right now they cannot, so the job's output is a red mark with no actionable content, which trains people to ignore it.
Related
Found by:
claude-jitfields-to-fastfields.The
lint (clang-format, changed lines)job in.github/workflows/ci.ymlcan never show what it objects to. Every failure renders as a bareexit code 1, which makes an advisory job useless as advice.Cause
The step runs under
set -euo pipefailand captures the diff into a variable:git-clang-format --diffexits 1 whenever it would reformat something — that is its documented contract, not an error. Underset -e, a failing command substitution in an assignment aborts the shell at that line, so the script dies before reachingcase. The entire reporting branch — the diff, the::error::annotation, and the "Run: git clang-format …" hint — is dead code in exactly the situation it exists for.The clean path works, which is why this went unnoticed: a passing run reaches
casenormally.Fix
Stop treating exit 1 as fatal for that one command, e.g.
or capture the status explicitly and branch on it. Worth also asserting in a test PR that the diff genuinely appears in the log, rather than assuming the fix works.
Why it matters more than it looks
The job is deliberately
continue-on-error: true— the comment above it explains that.clang-formatpostdates the tree, which is hand-column-aligned in many places, so only changed lines are checked and the one-shot reformat is left as its own reviewable change. That design only works if a contributor can see the proposed reformat and judge it. Right now they cannot, so the job's output is a red mark with no actionable content, which trains people to ignore it.Related
apt-get install nvidia-cuda-toolkitconsuming 95 of 120 minutes, not a formatting problem.rerun_failed_jobsdoes pick upcancelledjobs, not just failed ones.