#!/usr/bin/env bash

# To install:
#
#    pip3 install git-pylint-commit-hook
#    chmod +x pre-commit
#    cp pre-commit ../.git/hooks

git-pylint-commit-hook

# From .git/hooks
BASE=`dirname $0`/../..
cd $BASE || exit 1
BASE=`pwd`
cd tests
for t in test_*.py ; do
    # TODO: fix test_gauge.py to run from anywhere
    if [ "$t" != "test_gauge.py" ] ; then
        cd $BASE/tests && PYTHONPATH=$BASE python3 $t || exit 1
    fi
done
