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

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

install:  ## Install package in development mode
	pip install -e .

install-dev:  ## Install package with development dependencies
	pip install -e ".[dev]"

verify:  ## Verify installation
	python verify_install.py

test:  ## Run tests
	pytest tests/ -v

test-cov:  ## Run tests with coverage report
	pytest tests/ --cov=burt_logger --cov-report=html --cov-report=term

test-watch:  ## Run tests in watch mode
	pytest-watch tests/

lint:  ## Run linters (flake8, mypy)
	flake8 burt_logger/ tests/ examples/ --max-line-length=100 --ignore=E203,W503
	mypy burt_logger/ --ignore-missing-imports

format:  ## Format code with black and isort
	black burt_logger/ tests/ examples/
	isort burt_logger/ tests/ examples/

format-check:  ## Check code formatting without changes
	black --check burt_logger/ tests/ examples/
	isort --check-only burt_logger/ tests/ examples/

quality:  ## Run all quality checks (format, lint, test)
	@echo "Running black..."
	@black --check burt_logger/ tests/ examples/
	@echo "Running isort..."
	@isort --check-only burt_logger/ tests/ examples/
	@echo "Running flake8..."
	@flake8 burt_logger/ tests/ examples/ --max-line-length=100 --ignore=E203,W503
	@echo "Running mypy..."
	@mypy burt_logger/ --ignore-missing-imports
	@echo "Running tests..."
	@pytest tests/ --cov=burt_logger
	@echo "All quality checks passed!"

examples:  ## Run example scripts
	python examples/simple_example.py

clean:  ## Remove build artifacts and cache files
	rm -rf build/
	rm -rf dist/
	rm -rf *.egg-info
	rm -rf .pytest_cache
	rm -rf .coverage
	rm -rf htmlcov/
	rm -rf .mypy_cache
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete

build:  ## Build distribution packages
	python -m build

publish-test:  ## Publish to TestPyPI
	python -m twine upload --repository testpypi dist/*

publish:  ## Publish to PyPI
	python -m twine upload dist/*

docs:  ## Generate documentation (future)
	@echo "Documentation generation coming soon..."

.DEFAULT_GOAL := help

