fix pre-commit install process (#31445)

* fix pre-commit install process

* only install pre-commit from a git repo
pull/31464/head
Jason Young 1 year ago committed by GitHub
parent beab6e8658
commit 991d02ba27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      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

Loading…
Cancel
Save