Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (41 loc) · 1.46 KB
/
Copy pathMakefile
File metadata and controls
48 lines (41 loc) · 1.46 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
.PHONY: install lint format typecheck validate pre-commit help
help:
@echo ""
@echo "agent-deployment-template — available targets"
@echo ""
@echo " install Install dev dependencies and git hooks for the template repo"
@echo " lint Lint hooks/ with ruff"
@echo " format Format hooks/ with ruff"
@echo " typecheck Type-check hooks/ with pyright"
@echo " validate Generate a test project and run its lint + unit + integration tests"
@echo " pre-commit Run all pre-commit hooks on all files"
@echo ""
install:
uv sync
uv run pre-commit install
uv run pre-commit install --hook-type commit-msg
lint:
uv run ruff check hooks/
format:
uv run ruff format hooks/
typecheck:
uv run pyright hooks/
validate:
@echo "Generating test project from template..."
rm -rf /tmp/cc-validate
cookiecutter . --no-input \
--output-dir /tmp/cc-validate \
project_name="Test Agent" \
author_email="test@example.com" \
gcp_project_id="test-project-123"
@echo "Running lint and tests in generated project..."
cd /tmp/cc-validate/test-agent && uv sync --frozen
cd /tmp/cc-validate/test-agent && uv run ruff check .
cd /tmp/cc-validate/test-agent && uv run ruff format --check .
cd /tmp/cc-validate/test-agent && uv run pytest tests/unit -v --no-cov
cd /tmp/cc-validate/test-agent && uv run pytest tests/integration -v --tb=short --no-cov
@echo ""
@echo "Template validation passed."
rm -rf /tmp/cc-validate
pre-commit:
uv run pre-commit run --all-files