.PHONY: install install-dev lint format typecheck test test-cov clean build publish

# Installation
install:
	pip install -e .

install-dev:
	pip install -e ".[all]"
	pip install ruff mypy pytest pytest-cov

# Code quality
lint:
	ruff check .

format:
	ruff format .

typecheck:
	mypy lesscode_database --ignore-missing-imports

check: lint format typecheck

# Testing
test:
	pytest -v

test-cov:
	pytest --cov=lesscode_database --cov-report=term --cov-report=html

# Cleanup
clean:
	rm -rf build/ dist/ *.egg-info .pytest_cache/ __pycache__/
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
	find . -type f -name *.pyc -delete

# Build & publish
build: clean
	uv build

publish: build
	uvx twine upload dist/*
