Files
claude-scripts/Makefile

81 lines
2.8 KiB
Makefile

.PHONY: help install install-dev test test-cov lint format typecheck clean build publish precommit analyze
SHELL := /bin/bash
VENV := .venv
PYTHON := $(VENV)/bin/python
UV := uv
help: ## Show this help message
@echo "Usage: make [target]"
@echo ""
@echo "Available targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
install: ## Install production dependencies
@echo "Activating virtual environment and installing production dependencies..."
@source $(VENV)/bin/activate && $(UV) pip install -e .
install-dev: ## Install development dependencies
@echo "Activating virtual environment and installing all dependencies..."
@source $(VENV)/bin/activate && $(UV) pip install -e ".[dev]"
@echo "Installing pre-commit hooks..."
@source $(VENV)/bin/activate && pre-commit install
test: ## Run tests
@echo "Running tests..."
@source $(VENV)/bin/activate && pytest
test-cov: ## Run tests with coverage
@echo "Running tests with coverage..."
@source $(VENV)/bin/activate && pytest --cov=quality --cov-report=term-missing
lint: ## Run linting checks
@echo "Running ruff linting..."
@source $(VENV)/bin/activate && ruff check src/
@echo "Running ruff format check..."
@source $(VENV)/bin/activate && ruff format --check src/
format: ## Format code
@echo "Formatting code with ruff..."
@source $(VENV)/bin/activate && ruff check --fix src/
@source $(VENV)/bin/activate && ruff format src/
typecheck: ## Run type checking
@echo "Running mypy type checking..."
@source $(VENV)/bin/activate && mypy src/
clean: ## Clean build artifacts
@echo "Cleaning build artifacts..."
@rm -rf dist/ build/ *.egg-info
@rm -rf .pytest_cache .mypy_cache .ruff_cache
@rm -rf htmlcov/ .coverage coverage.xml
@find . -type d -name __pycache__ -exec rm -rf {} +
@find . -type f -name "*.pyc" -delete
build: ## Build distribution packages
@echo "Building distribution packages..."
@source $(VENV)/bin/activate && python -m build
publish: ## Publish to PyPI
@echo "Publishing to PyPI..."
@source $(VENV)/bin/activate && python -m twine upload dist/*
precommit: ## Run pre-commit on all files
@echo "Running pre-commit on all files..."
@source $(VENV)/bin/activate && pre-commit run --all-files
analyze: ## Run full code quality analysis
@echo "Running full code quality analysis..."
@source $(VENV)/bin/activate && claude-quality full-analysis src/ --format console
venv: ## Create virtual environment
@echo "Creating virtual environment..."
@python3.12 -m venv $(VENV)
@echo "Virtual environment created at $(VENV)"
update-deps: ## Update all dependencies
@echo "Updating dependencies..."
@source $(VENV)/bin/activate && $(UV) pip install --upgrade -e ".[dev]"
check-all: lint typecheck test ## Run all checks (lint, typecheck, test)