diff --git a/.claude/hooks/pre-push-spotless.sh b/.claude/hooks/pre-push-spotless.sh index ff989f68a6..7acf98eb73 100755 --- a/.claude/hooks/pre-push-spotless.sh +++ b/.claude/hooks/pre-push-spotless.sh @@ -63,15 +63,10 @@ before="$(git diff HEAD -- '*.kt' '*.kts' 2>/dev/null | sha1sum)" log="$(mktemp /tmp/spotless-gate.XXXXXX.log)" if ! ./gradlew spotlessApply >"$log" 2>&1; then - # Distinguish a formatting failure (block) from Gradle being unable to RUN — - # e.g. deps can't resolve in a restricted sandbox. An infra failure must not - # strand the agent; warn and let CI's spotlessCheck be the backstop. - if grep -qiE "could not resolve|could not (get|download)|handshake|connect timed out|no address|unable to (find|resolve) host|read timed out" "$log"; then - echo "WARN: could not run spotlessApply (Gradle infra/network failure), skipping the formatting gate." >&2 - echo " CI's spotlessCheck still enforces formatting on the PR." >&2 - rm -f "$log" - exit 0 - fi + # Any failure blocks. The web sandbox pre-seeds the Gradle distribution (see + # .claude/hooks/session-start.sh) and Gradle resolves deps through the proxy, + # so spotlessApply no longer fails for infra reasons — a failure here is a + # real formatting/compile error, not a restricted-sandbox hiccup. echo "BLOCKED: spotlessApply failed — fix the build/formatting error before pushing." >&2 echo "----- gradle output (tail) -----" >&2 tail -n 40 "$log" >&2