Skip to content

Commit

Permalink
Update Git hooks for Python
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudcolas committed May 3, 2020
1 parent e51fc03 commit 5fbcd75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
12 changes: 12 additions & 0 deletions .githooks/pre-commit.5.format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 5 additions & 14 deletions .githooks/pre-commit.6.lint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5fbcd75

Please sign in to comment.