More scripts support

This commit is contained in:
2022-09-18 21:34:48 -05:00
parent f9a8c19066
commit 39c2229a1e
5 changed files with 41 additions and 16 deletions

View File

@@ -4,5 +4,8 @@
if [ -d venv ]; then
source venv/bin/activate
elif [ -f requirements.txt ]; then
python3 -m venv venv
venv/bin/python3 -m pip install -r requirements.txt
fi
python3 -m pytest

View File

@@ -2,11 +2,6 @@
# Sourced from https://github.com/git/git/blob/master/templates/hooks--pre-commit.sample
if egrep -irl '\s\+$' .; then
echo The above lines have trailing whitespace. Run "sed -i 's/\s\+$//'" on the affected files.
exit 1
fi
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
@@ -18,6 +13,9 @@ fi
# Redirect output to stderr.
exec 1>&2
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --
git diff-index --check --cached $against --
if [ $? -ne 0 ]; then
echo The above lines have trailing whitespace. Run "sed -i 's/\s\+$//'" on the affected files.
exit 1
fi