# Codex App Server Client SDK - Makefile
# Standard development tasks for this Python project

.PHONY: help install lint format format-check type-check test test-quick fix pre-commit clean

# Default target
help:
	@echo "Available targets:"
	@echo "  install       Install/sync dependencies (uv sync --all-extras)"
	@echo "  lint          Run ruff linter on src/ and tests/"
	@echo "  format        Format code with ruff"
	@echo "  format-check  Check formatting without modifying files"
	@echo "  type-check    Run mypy strict type checking on src/"
	@echo "  test          Run pytest with coverage"
	@echo "  test-quick    Run pytest without coverage (faster)"
	@echo "  fix           Auto-fix linting issues with ruff"
	@echo "  pre-commit    Run all checks (format-check, lint, type-check, test)"
	@echo "  clean         Remove cache files and build artifacts"

# Install dependencies
install:
	uv sync --all-extras

# Run linter
lint:
	uv run ruff check src/ tests/

# Format code
format:
	uv run ruff format src/ tests/

# Check formatting without modifying files
format-check:
	uv run ruff format --check src/ tests/

# Run type checker
type-check:
	uv run mypy src/

# Run tests with coverage
test:
	uv run pytest --cov

# Run tests without coverage (faster)
test-quick:
	uv run pytest

# Auto-fix linting issues
fix:
	uv run ruff check --fix src/ tests/

# Run all checks (CI-like)
pre-commit: format-check lint type-check test-quick

# Clean cache files and build artifacts
clean:
	rm -rf .uv-cache
	rm -rf .pytest_cache
	rm -rf .mypy_cache
	rm -rf .ruff_cache
	rm -rf build/
	rm -rf dist/
	rm -rf *.egg-info
	find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
	find . -type f -name "*.pyc" -delete 2>/dev/null || true
