|
1 | | -.PHONY: help install dev-install clean test lint format type-check security check pre-commit-install pre-commit-run build release |
| 1 | +.PHONY: help install clean test test-race build release fmt vet check |
| 2 | + |
| 3 | +VERSION ?= dev |
| 4 | +GOFLAGS ?= |
2 | 5 |
|
3 | | -# Default target |
4 | 6 | help: |
5 | 7 | @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 test-cov - Run tests with coverage (HTML + terminal)" |
11 | | - @echo " make test-cov-xml - Run tests with coverage (HTML + terminal + XML)" |
12 | | - @echo " make test-comprehensive - Run comprehensive tests with full coverage" |
13 | | - @echo " make test-coverage-summary - Show coverage summary report" |
14 | | - @echo " make lint - Run linting (flake8)" |
15 | | - @echo " make format - Format code (black, isort)" |
16 | | - @echo " make type-check - Run type checking (mypy)" |
17 | | - @echo " make security - Run security checks (bandit)" |
18 | | - @echo " make check - Run all quality checks (lint, type-check, test)" |
19 | | - @echo " make pre-commit-install - Install pre-commit hooks" |
20 | | - @echo " make pre-commit-run - Run pre-commit on all files" |
21 | | - @echo " make build - Build distribution packages" |
22 | | - @echo " make release - Full release workflow (clean, test, build)" |
| 8 | + @echo " make build - Build Go binaries into dist/" |
| 9 | + @echo " make install - Build and install cam/code-agent-manager" |
| 10 | + @echo " make test - Run Go test suite" |
| 11 | + @echo " make test-race - Run Go tests with race detector" |
| 12 | + @echo " make fmt - Format Go code" |
| 13 | + @echo " make vet - Run go vet" |
| 14 | + @echo " make check - Run fmt check, vet, tests, and install smoke test" |
| 15 | + @echo " make clean - Remove build artifacts" |
23 | 16 |
|
24 | | -# Installation |
25 | 17 | install: |
26 | | - pip install -e . |
27 | | - |
28 | | -dev-install: |
29 | | - pip install -e ".[dev]" |
30 | | - $(MAKE) pre-commit-install |
| 18 | + VERSION=$(VERSION) ./install.sh install |
31 | 19 |
|
32 | | -# Cleaning |
33 | 20 | clean: |
34 | | - rm -rf build/ |
35 | 21 | rm -rf dist/ |
36 | | - rm -rf *.egg-info |
37 | | - rm -rf .pytest_cache/ |
38 | | - rm -rf .mypy_cache/ |
39 | | - rm -rf .tox/ |
40 | | - rm -rf htmlcov/ |
41 | | - rm -rf .coverage |
42 | | - find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true |
43 | | - find . -type f -name "*.pyc" -delete |
44 | | - find . -type f -name "*.pyo" -delete |
45 | | - find . -type f -name "*.orig" -delete |
46 | | - |
47 | | -# Testing |
48 | | -test: |
49 | | - pytest tests/ -v |
50 | | - |
51 | | -test-cov: |
52 | | - pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term |
53 | | - |
54 | | -test-cov-xml: |
55 | | - pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term --cov-report=xml |
56 | | - |
57 | | -test-comprehensive: |
58 | | - pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term --cov-report=xml --tb=short --maxfail=5 |
59 | | - |
60 | | -test-coverage-summary: |
61 | | - python -m coverage report --include="code_assistant_manager/*" --omit="tests/*" --sort=cover |
| 22 | + find . -type f -name "*.test" -delete |
| 23 | + find . -type f -name "coverage.out" -delete |
62 | 24 |
|
63 | | -# Code quality |
64 | | -lint: |
65 | | - @echo "Running flake8..." |
66 | | - flake8 code_assistant_manager/ |
| 25 | +build: |
| 26 | + mkdir -p dist |
| 27 | + go build $(GOFLAGS) -ldflags "-X main.version=$(VERSION)" -o dist/cam ./cmd/cam |
| 28 | + go build $(GOFLAGS) -ldflags "-X main.version=$(VERSION)" -o dist/code-agent-manager ./cmd/code-agent-manager |
67 | 29 |
|
68 | | -format: |
69 | | - @echo "Running isort..." |
70 | | - isort code_assistant_manager/ tests/ |
71 | | - @echo "Running black..." |
72 | | - black code_assistant_manager/ tests/ |
| 30 | +test: |
| 31 | + go test $(GOFLAGS) ./... |
73 | 32 |
|
74 | | -format-check: |
75 | | - @echo "Checking isort..." |
76 | | - isort --check-only code_assistant_manager/ tests/ |
77 | | - @echo "Checking black..." |
78 | | - black --check code_assistant_manager/ tests/ |
| 33 | +test-race: |
| 34 | + go test $(GOFLAGS) -race ./... |
79 | 35 |
|
80 | | -type-check: |
81 | | - @echo "Running mypy..." |
82 | | - mypy code_assistant_manager/ |
| 36 | +fmt: |
| 37 | + gofmt -s -w cmd internal |
83 | 38 |
|
84 | | -security: |
85 | | - @echo "Running bandit..." |
86 | | - bandit -r code_assistant_manager/ -c pyproject.toml |
| 39 | +fmt-check: |
| 40 | + @test -z "$$(gofmt -s -l cmd internal)" || (gofmt -s -l cmd internal && exit 1) |
87 | 41 |
|
88 | | -docstring-check: |
89 | | - @echo "Checking docstring coverage..." |
90 | | - interrogate code_assistant_manager/ -c pyproject.toml |
| 42 | +vet: |
| 43 | + go vet ./... |
91 | 44 |
|
92 | | -# Combined checks |
93 | | -check: format-check lint type-check test |
| 45 | +check: fmt-check vet test |
| 46 | + bash tests/verify_go_cli_install.sh |
94 | 47 | @echo "All checks passed!" |
95 | 48 |
|
96 | | -# Pre-commit |
97 | | -pre-commit-install: |
98 | | - pre-commit install |
99 | | - @echo "Pre-commit hooks installed successfully!" |
100 | | - |
101 | | -pre-commit-run: |
102 | | - pre-commit run --all-files |
103 | | - |
104 | | -pre-commit-update: |
105 | | - pre-commit autoupdate |
106 | | - |
107 | | -# Building |
108 | | -build: clean |
109 | | - python3 setup.py bdist_wheel |
110 | | - |
111 | | -# Release workflow |
112 | 49 | release: clean check build |
113 | 50 | @echo "Release build completed successfully!" |
114 | | - @echo "Distribution files:" |
115 | 51 | @ls -lh dist/ |
116 | | - |
117 | | -# Docker commands (future) |
118 | | -docker-build: |
119 | | - @echo "Docker build not yet implemented" |
120 | | - |
121 | | -docker-run: |
122 | | - @echo "Docker run not yet implemented" |
0 commit comments