From d6b95f3d2cb673aab2ec11cadf2560e564cc7acf Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 13 Mar 2022 16:18:01 -0700 Subject: [PATCH] install pre-commit hooks for all submodules old-commit-hash: 8252134e62440ae2d19e6dce20ff9475389cdd06 --- update_requirements.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/update_requirements.sh b/update_requirements.sh index ac9472dca2..dd5d933526 100755 --- a/update_requirements.sh +++ b/update_requirements.sh @@ -1,5 +1,4 @@ #!/bin/bash - set -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" @@ -45,10 +44,8 @@ echo "pip packages install..." pipenv install --dev --deploy --clear pyenv rehash -if [ -f "$DIR/.pre-commit-config.yaml" ]; then - echo "precommit install ..." +echo "pre-commit hooks install..." +for f in .pre-commit-config.yaml */.pre-commit-config.yaml; do + cd $DIR/$(dirname $f) $RUN pre-commit install - [ -d "./xx" ] && (cd xx && $RUN pre-commit install) - [ -d "./notebooks" ] && (cd notebooks && $RUN pre-commit install) - echo "pre-commit hooks installed" -fi +done