#!/bin/bash
set -e

echo 'Starting Linting'
uv run --group dev --frozen ruff check payment tests *.py --no-cache
uv run --group dev --frozen ruff format payment tests *py --check --diff --no-cache

echo 'Starting tests'
COVERAGE_FILE=build/.coverage uv run --group dev --frozen pytest tests/unit tests/functional \
    --cov payment \
    --cov-report term \
    --cov-report xml:build/coverage.xml \
    --html=build/report.html \
    --self-contained-html \
    --ignore=tests/integration/ \
    --junitxml=build/pyunit.xml \
    -p no:cacheprovider \
    -v

echo 'Successfully ran linting and tests'
