#!/bin/bash

set -e

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

ruff check contracts/ tests/ application.py dev.py --no-cache
ruff format contracts/ tests/ application.py dev.py --check --no-cache

# run pytest with args set
echo 'Running tests...'
PYTHONDONTWRITEBYTECODE=1 COVERAGE_FILE=build/.coverage python -m pytest -v tests/ \
		-p no:cacheprovider \
		--ignore=tests/integration \
		--cov contracts tests \
		--cov-report xml:build/coverage.xml \
		--cov-report term \
		--junitxml=build/pyunit.xml

echo 'Done!'
