#!/usr/bin/env bash

set -e

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

echo "Running ruff..."
poetry run ruff m2mconfig tests scripts --no-cache

echo "Running ruff format..."
poetry run ruff format m2mconfig tests scripts --check --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 m2mconfig \
  --cov-report xml:build/coverage.xml \
  --cov-report term \
  --junitxml=build/pyunit.xml
