Testeando el codigo!

This commit is contained in:
Daniel Cortes
2020-06-13 01:18:09 -04:00
parent b806b1163c
commit a7984779f7
5 changed files with 245 additions and 2 deletions

View File

@@ -2,5 +2,28 @@
set -eu
. venv/bin/activate
STASH_NAME=pre-commit-$(date +%s)
git stash save -q --keep-index $STASH_NAME
flake8 .
exit $?
FLAKE_8=$?
./test.sh
TEST=$?
STASH_NUM=$(git stash list | grep $STASH_NAME | sed -re 's/stash@\{(.*)\}.*/\1/')
if [ -n "$STASH_NUM" ]; then
git stash pop -q stash@{$STASH_NUM}
fi
if [ $FLAKE_8 -ne 0 ]; then
exit $FLAKE_8
fi
if [ $TEST -ne 0 ]; then
exit $TEST
fi
exit 0