|
| 1 | +.PHONY: help install dev-install clean test lint format type-check security check pre-commit-install pre-commit-run build release |
| 2 | + |
| 3 | +# Default target |
| 4 | +help: |
| 5 | + @echo "Available commands:" |
| 6 | + @echo " make install - Install package for production use" |
| 7 | + @echo " make dev-install - Install package with development dependencies" |
| 8 | + @echo " make clean - Remove build artifacts and caches" |
| 9 | + @echo " make test - Run test suite" |
| 10 | + @echo " make lint - Run linting (flake8)" |
| 11 | + @echo " make format - Format code (black, isort)" |
| 12 | + @echo " make type-check - Run type checking (mypy)" |
| 13 | + @echo " make security - Run security checks (bandit)" |
| 14 | + @echo " make check - Run all quality checks (lint, type-check, test)" |
| 15 | + @echo " make pre-commit-install - Install pre-commit hooks" |
| 16 | + @echo " make pre-commit-run - Run pre-commit on all files" |
| 17 | + @echo " make build - Build distribution packages" |
| 18 | + @echo " make release - Full release workflow (clean, test, build)" |
| 19 | + |
| 20 | +# Installation |
| 21 | +install: |
| 22 | + pip install -e . |
| 23 | + |
| 24 | +dev-install: |
| 25 | + pip install -e ".[dev]" |
| 26 | + $(MAKE) pre-commit-install |
| 27 | + |
| 28 | +# Cleaning |
| 29 | +clean: |
| 30 | + rm -rf build/ |
| 31 | + rm -rf dist/ |
| 32 | + rm -rf *.egg-info |
| 33 | + rm -rf .pytest_cache/ |
| 34 | + rm -rf .mypy_cache/ |
| 35 | + rm -rf .tox/ |
| 36 | + rm -rf htmlcov/ |
| 37 | + rm -rf .coverage |
| 38 | + find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true |
| 39 | + find . -type f -name "*.pyc" -delete |
| 40 | + find . -type f -name "*.pyo" -delete |
| 41 | + find . -type f -name "*.orig" -delete |
| 42 | + |
| 43 | +# Testing |
| 44 | +test: |
| 45 | + pytest tests/ -v |
| 46 | + |
| 47 | +test-cov: |
| 48 | + pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term |
| 49 | + |
| 50 | +# Code quality |
| 51 | +lint: |
| 52 | + @echo "Running flake8..." |
| 53 | + flake8 code_assistant_manager/ |
| 54 | + |
| 55 | +format: |
| 56 | + @echo "Running isort..." |
| 57 | + isort code_assistant_manager/ tests/ |
| 58 | + @echo "Running black..." |
| 59 | + black code_assistant_manager/ tests/ |
| 60 | + |
| 61 | +format-check: |
| 62 | + @echo "Checking isort..." |
| 63 | + isort --check-only code_assistant_manager/ tests/ |
| 64 | + @echo "Checking black..." |
| 65 | + black --check code_assistant_manager/ tests/ |
| 66 | + |
| 67 | +type-check: |
| 68 | + @echo "Running mypy..." |
| 69 | + mypy code_assistant_manager/ |
| 70 | + |
| 71 | +security: |
| 72 | + @echo "Running bandit..." |
| 73 | + bandit -r code_assistant_manager/ -c pyproject.toml |
| 74 | + |
| 75 | +docstring-check: |
| 76 | + @echo "Checking docstring coverage..." |
| 77 | + interrogate code_assistant_manager/ -c pyproject.toml |
| 78 | + |
| 79 | +# Combined checks |
| 80 | +check: format-check lint type-check test |
| 81 | + @echo "All checks passed!" |
| 82 | + |
| 83 | +# Pre-commit |
| 84 | +pre-commit-install: |
| 85 | + pre-commit install |
| 86 | + @echo "Pre-commit hooks installed successfully!" |
| 87 | + |
| 88 | +pre-commit-run: |
| 89 | + pre-commit run --all-files |
| 90 | + |
| 91 | +pre-commit-update: |
| 92 | + pre-commit autoupdate |
| 93 | + |
| 94 | +# Building |
| 95 | +build: clean |
| 96 | + python3 setup.py bdist_wheel |
| 97 | + |
| 98 | +# Release workflow |
| 99 | +release: clean check build |
| 100 | + @echo "Release build completed successfully!" |
| 101 | + @echo "Distribution files:" |
| 102 | + @ls -lh dist/ |
| 103 | + |
| 104 | +# Docker commands (future) |
| 105 | +docker-build: |
| 106 | + @echo "Docker build not yet implemented" |
| 107 | + |
| 108 | +docker-run: |
| 109 | + @echo "Docker run not yet implemented" |
0 commit comments