#!/usr/bin/env bash

set -e

: "${SKIP_LINT:=0}"


if [ "$SKIP_LINT" -ne 1 ]; then
    echo 'Running yaml linter...'
    python -u -m yamllint docker-compose.yaml
    echo 'Running python linter...'
    python -u -m ruff check src tests app.py
else
    echo 'Skipping linting...'
fi

# Run tests with coverage
echo 'Running tests with coverage...'
python -u -m pytest --cov=src --cov=app -p no:cacheprovider $TEST_ARGS tests/

echo 'Done!'
