about summary refs log tree commit diff
path: root/src/etc/pre-push.sh
diff options
context:
space:
mode:
authorShunpoco <tkngsnsk313320@gmail.com>2025-09-27 14:10:06 +0100
committerShunpoco <tkngsnsk313320@gmail.com>2025-09-27 17:39:06 +0100
commitaef976ed4c73dab044002b39817509110ddf2cf2 (patch)
tree2d11aae49ae17b0283458f85e0c18aa16efc4e09 /src/etc/pre-push.sh
parentade84871f718ea20a6460d28e82290353b4bf3d2 (diff)
downloadrust-aef976ed4c73dab044002b39817509110ddf2cf2.tar.gz
rust-aef976ed4c73dab044002b39817509110ddf2cf2.zip
Add auto extra-checks in pre-push script
It enables automatic check changes of Python/C++/JS
before pushing the changes to remote repository.
Those checks happen only when the target type of file is changed.
Otherwise it does not install any dependencies (venv and/or node_modules).
Note that shellcheck and spellcheck are not included in this change, because:
1. Unlike venv/node_modules, shellcheck is not installed automatically by the command, and
2. spellcheck is built whenever pre-push script is run, it forces developer to wait extra time
So not to break the current productivity, this commit skips them.
Diffstat (limited to 'src/etc/pre-push.sh')
-rwxr-xr-xsrc/etc/pre-push.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/etc/pre-push.sh b/src/etc/pre-push.sh
index 7bacc943f25..33ed2f0e406 100755
--- a/src/etc/pre-push.sh
+++ b/src/etc/pre-push.sh
@@ -26,7 +26,10 @@ ROOT_DIR="$(git rev-parse --show-toplevel)"
 echo "Running pre-push script $ROOT_DIR/x test tidy"
 
 cd "$ROOT_DIR"
-./x test tidy --set build.locked-deps=true
+# The env var is necessary for printing diffs in py (fmt/lint) and cpp.
+TIDY_PRINT_DIFF=1 ./x test tidy \
+    --set build.locked-deps=true \
+    --extra-checks auto:py,auto:cpp,auto:js
 if [ $? -ne 0 ]; then
     echo "You may use \`git push --no-verify\` to skip this check."
     exit 1