#!/bin/bash
set -e

# if venv doesn't exist, invoke ./install
if [ ! -d ".venv" ]; then
    echo "No venv present, so installing..."
    ./install
fi

. ./activate

echo Running ruff src compiler
ruff check --fix src compiler
echo Running ruff tests compiler
ruff check --fix tests compiler
echo Running black src tests compiler
black src tests compiler
echo Running isort src tests compiler
isort --profile black src tests compiler
echo Running pyright src tests compiler
uv run pyright src compiler tests
echo Linting complete!
exit 0
