From af9122c7991463f6346b11e450c9ca56d8f03dea Mon Sep 17 00:00:00 2001 From: Jason Young <46612682+jyoung8607@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:19:20 -0500 Subject: [PATCH] fix pre-commit install process (#31445) * fix pre-commit install process * only install pre-commit from a git repo old-commit-hash: 991d02ba27cf84e7140aedd5ca4173ffe5cb0d58 --- tools/install_python_dependencies.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tools/install_python_dependencies.sh b/tools/install_python_dependencies.sh index 6753afffb9..f7ba316480 100755 --- a/tools/install_python_dependencies.sh +++ b/tools/install_python_dependencies.sh @@ -75,12 +75,8 @@ pyenv rehash [ -n "$POETRY_VIRTUALENVS_CREATE" ] && RUN="" || RUN="poetry run" -if [ "$(uname)" != "Darwin" ]; then +if [ "$(uname)" != "Darwin" ] && [ -e "$ROOT/.git" ]; then echo "pre-commit hooks install..." - shopt -s nullglob - for f in .pre-commit-config.yaml */.pre-commit-config.yaml; do - if [ -e "$ROOT/$(dirname $f)/.git" ]; then - $RUN pre-commit install -c "$f" - fi - done + $RUN pre-commit install + $RUN git submodule foreach pre-commit install fi