Skip to content

Commit 76d61a0

Browse files
authored
fix: speed up precommit builds (#284)
1 parent 258706a commit 76d61a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.githooks/pre-commit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fi
8787
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ]
8888
then
8989
echo_status "Running Java linter..."
90-
bazel build --disk_cache="$BAZEL_CACHE_DIR" //:google_java_format_verification
90+
bazel --batch build --disk_cache="$BAZEL_CACHE_DIR" //:google_java_format_verification
9191
FORMAT_STATUS=$?
9292
if [ $FORMAT_STATUS != 0 ]
9393
then
@@ -100,7 +100,7 @@ fi
100100
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] || [ $NUM_BAZEL_FILES_CHANGED -gt 0 ]
101101
then
102102
echo_status "Checking the build..."
103-
bazel build --disk_cache="$BAZEL_CACHE_DIR" //...
103+
bazel --batch build --disk_cache="$BAZEL_CACHE_DIR" //...
104104
BUILD_STATUS=$?
105105
if [ $BUILD_STATUS != 0 ]
106106
then
@@ -112,7 +112,7 @@ fi
112112
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ]
113113
then
114114
echo_status "Checking tests..."
115-
bazel test --disk_cache="$BAZEL_CACHE_DIR" //...
115+
bazel --batch test --disk_cache="$BAZEL_CACHE_DIR" //...
116116
TEST_STATUS=$?
117117
if [ $TEST_STATUS != 0 ]
118118
then

0 commit comments

Comments
 (0)