#!/bin/sh -e

export PREFIX=""
if [ -d 'venv' ] ; then
    export PREFIX="venv/bin/"
fi
export SOURCE_FILES="faust tests setup.py"

set -x

${PREFIX}isort --check --diff --project=faust $SOURCE_FILES
${PREFIX}black --check --diff $SOURCE_FILES
${PREFIX}flake8 $SOURCE_FILES
# Checks the faust package only, and only the modules that are already clean:
# see the ratchet list under [[tool.mypy.overrides]] in pyproject.toml.
${PREFIX}mypy -p faust
