#!/usr/bin/env bash

set -e

# run linting of python files
echo 'Running mypy...'
poetry run mypy --cache-dir=/dev/null accounting_run_utils tests 

echo "Running ruff linter..."
poetry run ruff check accounting_run_utils tests --no-cache

echo "Running ruff formatter check..."
poetry run ruff format accounting_run_utils tests --diff --no-cache

# run pytest with args set
echo 'Running tests...'

PYTHONDONTWRITEBYTECODE=1 COVERAGE_FILE=build/.coverage poetry run pytest tests/unit/ \
  -p no:cacheprovider \
  --cov accounting_run_utils \
  --cov-report xml:build/coverage.xml \
  --cov-report term \
  --junitxml=build/pyunit.xml \
  --verbose
