Skip to content

Commit aef976e

Browse files
committed
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.
1 parent ade8487 commit aef976e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/etc/pre-push.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ ROOT_DIR="$(git rev-parse --show-toplevel)"
2626
echo "Running pre-push script $ROOT_DIR/x test tidy"
2727

2828
cd "$ROOT_DIR"
29-
./x test tidy --set build.locked-deps=true
29+
# The env var is necessary for printing diffs in py (fmt/lint) and cpp.
30+
TIDY_PRINT_DIFF=1 ./x test tidy \
31+
--set build.locked-deps=true \
32+
--extra-checks auto:py,auto:cpp,auto:js
3033
if [ $? -ne 0 ]; then
3134
echo "You may use \`git push --no-verify\` to skip this check."
3235
exit 1

0 commit comments

Comments
 (0)