diff --git a/.githooks/pre-commit.5.format.sh b/.githooks/pre-commit.5.format.sh index 5bdd8dc..36b00b7 100755 --- a/.githooks/pre-commit.5.format.sh +++ b/.githooks/pre-commit.5.format.sh @@ -11,3 +11,15 @@ if [ -n "$PRETTIER_STAGED" ]; then npx prettier --check $PRETTIER_STAGED fi + +if [ -n "$PY_FULLY_STAGED" ]; +then + isort --recursive $PY_FULLY_STAGED + black $PY_FULLY_STAGED + git add $PY_FULLY_STAGED +fi + +if [ -n "$PY_STAGED" ]; +then + black --check $PY_STAGED +fi diff --git a/.githooks/pre-commit.6.lint.sh b/.githooks/pre-commit.6.lint.sh index b49163d..eae8689 100755 --- a/.githooks/pre-commit.6.lint.sh +++ b/.githooks/pre-commit.6.lint.sh @@ -1,16 +1,7 @@ #!/usr/bin/env bash -# if [ -n "$JS_STAGED" ]; -# then -# npx eslint $JS_STAGED -# fi - -# if [ -n "$SCSS_STAGED" ]; -# then -# npx stylelint $SCSS_STAGED -# fi - -# if [ -n "$PY_STAGED" ]; -# then -# flake8 $PY_STAGED -# fi +if [ -n "$PY_STAGED" ]; +then + flake8 $PY_STAGED + isort --check-only --diff --recursive $PY_STAGED +fi