-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
142 lines (118 loc) · 5.01 KB
/
Makefile
File metadata and controls
142 lines (118 loc) · 5.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# ADR Kit Development Makefile
# This Makefile is for DEVELOPMENT ONLY (not included in distribution package)
.PHONY: help install clean test-unit test-integration test-all test-server lint format build uninstall reinstall server dev-setup dev-cycle dev-reload quality release-prep setup-hooks
# =============================================================================
# Help & Documentation
# =============================================================================
help:
@echo "ADR Kit Development Commands"
@echo ""
@echo "Setup & Installation:"
@echo " install - Install in editable mode with uv"
@echo " uninstall - Remove adr-kit package"
@echo " reinstall - Clean uninstall + fresh install"
@echo " clean - Remove all generated artifacts"
@echo ""
@echo "Development & Testing:"
@echo " test-unit - Run unit tests only (fastest - no dependencies)"
@echo " test-integration - Run unit + integration tests (requires installation)"
@echo " test-all - Run all tests (includes MCP server tests)"
@echo " test-server - Run MCP server tests only"
@echo " lint - Run linting (ruff + mypy)"
@echo " format - Format code (black + ruff)"
@echo " server - Start MCP server"
@echo " build - Build distribution packages"
@echo ""
@echo "Workflows:"
@echo " setup-hooks - Install git pre-commit hook (format + lint on staged files)"
@echo " dev-setup - Initial development setup with guidance"
@echo " dev-cycle - clean + install + test"
@echo " dev-reload - reinstall + test (for after code changes)"
@echo " quality - format + lint + test"
@echo " release-prep - full preparation for release"
@echo ""
@echo "⚠️ This Makefile is for DEVELOPMENT use only."
# =============================================================================
# Setup & Installation
# =============================================================================
install:
@echo "🔧 Installing with uv..."
uv pip install -e ".[dev]"
@echo "✅ Installation complete"
uninstall:
@echo "🗑️ Removing adr-kit package..."
@chmod +x scripts/clean-install.sh
@scripts/clean-install.sh uninstall
@echo "✅ Uninstall complete"
reinstall:
@echo "🔄 Performing clean uninstall and fresh install..."
@chmod +x scripts/clean-install.sh
@scripts/clean-install.sh reinstall
@echo "✅ Reinstall complete"
clean:
@echo "🧹 Cleaning all generated artifacts..."
@chmod +x scripts/clean-install.sh
@scripts/clean-install.sh clean
@echo "✅ Clean complete"
# =============================================================================
# Development & Testing
# =============================================================================
test-unit:
@echo "🧪 Running unit tests (fastest - no dependencies)..."
uv run pytest tests/unit/ --cov=adr_kit --cov-report=term-missing
@echo "✅ Unit tests complete"
test-integration:
@echo "🧪 Running unit + integration tests (requires installation)..."
uv run pytest tests/unit/ tests/integration/ --cov=adr_kit --cov-report=term-missing
@echo "✅ Integration tests complete"
test-all:
@echo "🧪 Running all tests (includes MCP server tests)..."
uv run pytest tests/ -v --cov=adr_kit --cov-report=term-missing --cov-report=html
@echo "✅ All tests complete. Coverage report in htmlcov/"
test-server:
@echo "🧪 Running MCP server tests..."
uv run pytest tests/mcp/ -v
@echo "✅ MCP server tests complete"
lint:
@echo "🔍 Running linting..."
uv run ruff check adr_kit/ tests/
uv run mypy adr_kit/
@echo "✅ Linting complete"
format:
@echo "🎨 Formatting code..."
uv run black adr_kit/ tests/
uv run ruff check --fix adr_kit/ tests/
@echo "✅ Formatting complete"
server:
@echo "🚀 Starting MCP server..."
adr-kit mcp-server
build:
@echo "📦 Building distribution packages..."
python -m build
@echo "✅ Packages built in dist/"
# =============================================================================
# Workflows
# =============================================================================
setup-hooks:
@echo "🔗 Installing git hooks..."
@cp scripts/pre-commit .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "✅ Pre-commit hook installed"
dev-setup: install setup-hooks test-integration
@echo "✅ Development setup complete"
@echo "💡 Next steps:"
@echo " 1. Run 'make server' to start MCP server"
@echo " 2. Run 'make test-server' to test server functionality"
@echo " 3. Use 'make dev-reload' after making code changes"
dev-cycle: clean install test-integration
@echo "✅ Development cycle complete"
dev-reload: reinstall test-integration
@echo "✅ Code reloaded and tested"
@echo "💡 Next steps:"
@echo " - Run 'make test-server' if you changed MCP server code"
@echo " - Run 'make test-unit' for fastest feedback during development"
quality: format lint test-integration
@echo "✅ Quality checks passed"
release-prep: clean install format lint test-all build
@echo "✅ Release preparation complete"
@echo "📦 Distribution packages ready in dist/"