fix pre-commit install process (#31445)

* fix pre-commit install process

* only install pre-commit from a git repo
old-commit-hash: 991d02ba27
chrysler-long2
Jason Young 1 year ago committed by GitHub
parent 1f833f2ec5
commit af9122c799
  1. 10
      tools/install_python_dependencies.sh

@ -75,12 +75,8 @@ pyenv rehash
[ -n "$POETRY_VIRTUALENVS_CREATE" ] && RUN="" || RUN="poetry run" [ -n "$POETRY_VIRTUALENVS_CREATE" ] && RUN="" || RUN="poetry run"
if [ "$(uname)" != "Darwin" ]; then if [ "$(uname)" != "Darwin" ] && [ -e "$ROOT/.git" ]; then
echo "pre-commit hooks install..." echo "pre-commit hooks install..."
shopt -s nullglob $RUN pre-commit install
for f in .pre-commit-config.yaml */.pre-commit-config.yaml; do $RUN git submodule foreach pre-commit install
if [ -e "$ROOT/$(dirname $f)/.git" ]; then
$RUN pre-commit install -c "$f"
fi
done
fi fi

Loading…
Cancel
Save