#!/bin/bash

set -e

# run linting of python files
echo 'Running linting...'

autoflake --in-place --remove-all-unused-imports --remove-unused-variable --check .
black --skip-string-normalization --check .

# Boatloads of these are broken, fix it sometime maybe if anyone cares.
# isort --check-only

flake8 participant/ tests/

docformatter --in-place --blank participant/**.py tests/**.py

echo 'Running tests...'
export Environment=test
py.test \
    --cov participant tests/unit/ \
    --cov-report xml \
    --junitxml=pyunit.xml
