#!/usr/bin/env bash

# To install (from this directory):
#
#    pip3 install git-pylint-commit-hook mypy
#    chmod +x pre-commit
#    rm -f ../.git/hooks/pre-commit
#    ln -s ../../git-hook/pre-commit ../.git/hooks

git-pylint-commit-hook

# From .git/hooks
BASE=`dirname $0`/../..
cd $BASE || exit 1
BASE=`pwd`
for mypy_file in faucet/faucet.py faucet/gauge.py ; do
    PYTHONPATH=$BASE mypy --ignore-missing-imports $mypy_file || exit 1
done
cd tests
./test_coverage.sh || exit 1
