#!/usr/bin/env bash

set -e

cd "$(dirname "$0")/.."

if [ "${1:-}" = "--fix" ]; then
  echo "==> Running lints with --fix"
  uv run --locked --all-extras ruff check --fix .
else
  echo "==> Running lints"
  uv run --locked --all-extras ruff check .
  uv run --locked --all-extras scripts/run-pyright
  uv run --locked --all-extras mypy .
fi

echo "==> Making sure it imports"
uv run --locked --all-extras python -c 'import openai'
