Skip to content

Commit f31963f

Browse files
authored
Rollup merge of rust-lang#147098 - Shunpoco:issue-147088, r=Kobzol
Add auto extra-checks in pre-push hook Fixes rust-lang#147088 This PR adds auto py, cpp, and js extra checks into the pre-push script. - It checks those non-Rust files only if they are modified in the commit - Thanks to auto mode, the pre-push doesn't check them if none of them are modified. It means that it doesn't build venv, nor install node_packages under build/ Note that this PR doesn't add shellcheck and spellcheck, because - Currently shellcheck isn't installed by the tidy command unlike venv/node_modules. So it forces developers to take a extra task to enable pre-push hook - Spellcheck is built whenever I kick test tidy with the option. If I enables it, developers should wait extra time for running pre-push hook
2 parents 641beda + aef976e commit f31963f

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)