.PHONY: help install test lint format clean build wheel

help: ## Show this help message
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

install: ## Install dependencies using uv
	uv sync

install-dev: ## Install with dev dependencies
	uv sync --extra dev

test: ## Run tests with pytest
	uv run pytest

test-cov: ## Run tests with coverage
	uv run pytest --cov=gbtsvm --cov-report=term-missing

lint: ## Run linting with ruff
	uv run ruff check gbtsvm/ tests/

lint-fix: ## Run linting with auto-fix
	uv run ruff check --fix gbtsvm/ tests/

format: ## Format code with ruff
	uv run ruff format gbtsvm/ tests/

format-check: ## Check code formatting
	uv run ruff format --check gbtsvm/ tests/

clean: ## Clean build artifacts
	rm -rf build/ dist/ *.egg-info .pytest_cache .coverage htmlcov/
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true

build: clean ## Build the package
	uv build

wheel: ## Build wheel only
	uv build --wheel

check: lint format-check test ## Run all checks (lint, format, test)
