Precommit confirma que el lint esta gud

This commit is contained in:
Daniel Cortes
2020-06-07 23:44:17 -04:00
parent 8590668023
commit c447416981
2 changed files with 22 additions and 1 deletions

21
pre-commit.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
set -eu
STASH_NAME="pre-commit-$(date +%s)"
git stash save -q --keep-index $STASH_NAME
[ -d venv/ ] || python -m venv venv
. venv/bin/activate
pip install -r requirements.txt -r requirements-dev.txt
./lint.sh
LINT_RESULT=$?
STASHES=$(git stash list)
if [[ $STASHES == "$STASH_NAME" ]]; then
git stash pop -q
fi
exit $LINT_RESULT