Precommit confirma que el lint esta gud
This commit is contained in:
21
pre-commit.sh
Executable file
21
pre-commit.sh
Executable 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
|
||||
Reference in New Issue
Block a user