From acbd0f4ac81a98fc3af873fc958dab276bb52740 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 17 Jul 2026 02:16:35 +0000 Subject: [PATCH] refactor(hooks): drop the pre-push spotless infra-skip With the Gradle distribution now pre-seeded in the web sandbox (session-start.sh) and dependencies resolving through the proxy, spotlessApply no longer fails for infra reasons. Remove the network-error skip branch so any spotlessApply failure blocks the push: a failure now means a real formatting/compile error, and the narrow regex can no longer mask one. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01A7bocRTSPyXwz6zVMzDbKR --- .claude/hooks/pre-push-spotless.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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