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.
This commit is contained in:
Shunpoco 2025-09-27 14:10:06 +01:00
parent ade84871f7
commit aef976ed4c

View file

@ -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