Skip to content

Commit 0071088

Browse files
committed
dx: add scripts/verify.sh local gate + sample pre-push hook
1 parent faea635 commit 0071088

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

scripts/hooks/pre-push

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Sample pre-push hook. NOT auto-installed (git hooks live in .git/hooks, which is
3+
# not version-controlled). To use it:
4+
# ln -s ../../scripts/hooks/pre-push .git/hooks/pre-push
5+
# It runs the local verification gate and blocks the push on failure.
6+
set -euo pipefail
7+
exec "$(git rev-parse --show-toplevel)/scripts/verify.sh"

scripts/verify.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# One-command local verification gate. Runs ONLY the JVM-safe checks allowed for
3+
# local runs (format, compile, unit tests). Never assembles an APK (that is
4+
# Namespace/Depot only). Always stops the Gradle daemon at the end.
5+
#
6+
# Optional pre-push hook install (manual, not auto-wired):
7+
# ln -s ../../scripts/hooks/pre-push .git/hooks/pre-push
8+
set -euo pipefail
9+
10+
cd "$(dirname "$0")/.."
11+
12+
cleanup() { ./gradlew --stop >/dev/null 2>&1 || true; }
13+
trap cleanup EXIT
14+
15+
echo ">> spotlessKotlinCheck"
16+
./gradlew spotlessKotlinCheck
17+
18+
echo ">> compileOssDebugKotlin"
19+
./gradlew :app:compileOssDebugKotlin
20+
21+
echo ">> testOssDebugUnitTest"
22+
./gradlew :app:testOssDebugUnitTest
23+
24+
echo "OK: local verification passed."

0 commit comments

Comments
 (0)