.PHONY: all build check ci clean dev-install format format-check help install lint \
	lint-fix pre-commit-install pre-commit-run test test-all test-cov test-cov-all \
	test-slow

# Environment targets
dev-install:
	pixi install

install:
	pixi install

# Pre-commit targets
pre-commit-install: dev-install
	pixi run pre-commit-install

pre-commit-run:
	pixi run pre-commit-run

# Code quality targets
lint:
	pixi run lint

lint-fix:
	pixi run lint-fix

format:
	pixi run format

format-check:
	pixi run format-check

# Test targets
test:
	pixi run test

test-all:
	pixi run test-all

test-slow:
	pixi run test-slow

test-cov:
	pixi run test-cov

test-cov-all:
	pixi run test-cov-all

# Build targets
clean:
	rm -rf build/ dist/ *.egg-info/
	find . -type d -name "__pycache__" -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete

build: clean
	pixi run build-package

# Combined targets
check: lint format-check test

ci: lint format-check test-cov

all: dev-install pre-commit-install check build

# Help
help:
	@echo "Available targets:"
	@echo "  dev-install      - Install the Pixi development environment"
	@echo "  install          - Install the Pixi development environment"
	@echo "  pre-commit-install - Install pre-commit hooks"
	@echo "  pre-commit-run   - Run pre-commit on all files"
	@echo "  lint             - Run Ruff linting checks"
	@echo "  lint-fix         - Run Ruff linting with auto-fix"
	@echo "  format           - Format code with Ruff"
	@echo "  format-check     - Check code formatting"
	@echo "  test             - Run fast tests only"
	@echo "  test-all         - Run all tests"
	@echo "  test-slow        - Run slow tests only"
	@echo "  test-cov         - Run fast tests with coverage"
	@echo "  test-cov-all     - Run all tests with coverage"
	@echo "  clean            - Clean build artifacts"
	@echo "  build            - Build package"
	@echo "  check            - Run linting, formatting check, and tests"
	@echo "  ci               - Run linting, formatting check, and tests with coverage"
	@echo "  all              - Install deps, install pre-commit, run checks, and build"
	@echo "  help             - Show this help message"
