-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (77 loc) · 3.68 KB
/
Makefile
File metadata and controls
91 lines (77 loc) · 3.68 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
.PHONY: test lint run-example install validate-structure validate-spec validate-integrity validate-contract validate-quality scaffold-dry-run ci-local checklist
install:
python -m pip install poetry
poetry install
test:
poetry run pytest -v
lint:
poetry run ruff check guardsuite_core src tests
poetry run black --check guardsuite_core src tests
format:
poetry run black guardsuite_core src tests
poetry run ruff check --fix guardsuite_core src tests
run-example:
poetry run python -m pillar.cli scan tests/fixtures/minimal_plan.json
validate-structure:
python tools/validate_pillar_structure.py
validate-spec:
poetry run guardsuite-core-validate docs/spec.yml
validate-integrity:
poetry run pytest tests/unit/test_validate_spec_path.py -q
validate-contract:
poetry run pytest tests/unit/test_cli.py -q --disable-warnings
validate-quality: validate-structure validate-spec validate-integrity validate-contract
poetry run pytest \
tests/unit/test_cli.py \
tests/unit/test_scaffold_dry_run.py \
tests/snapshots \
-q --disable-warnings
scaffold-dry-run:
poetry run python scripts/scaffold_new_pillar.py example --dry-run
checklist:
python tools/render_checklist.py
ci-local:
@echo "=== Running CI checks locally ==="
@echo "1. Lint checks..."
@poetry run ruff check src tests || (echo "❌ Ruff check failed" && exit 1)
@poetry run black --check src tests || (echo "❌ Black check failed" && exit 1)
@echo "✓ Lint passed"
@echo "2. Schema validation..."
@poetry run pytest tests/snapshots/test_schema_snapshot.py -v --tb=short || (echo "❌ Schema validation failed" && exit 1)
@echo "✓ Schema validation passed"
@echo "3. Unit tests..."
@poetry run pytest tests/unit/ -v --tb=short || (echo "❌ Unit tests failed" && exit 1)
@echo "✓ Unit tests passed"
@echo "4. Snapshot tests..."
@poetry run pytest tests/snapshots/ tests/determinism/ -v --tb=short || (echo "❌ Snapshot tests failed" && exit 1)
@echo "✓ Snapshot tests passed"
@echo "5. WASM tests..."
@poetry run pytest tests/wasm/ -v --tb=short || (echo "❌ WASM tests failed" && exit 1)
@echo "✓ WASM tests passed"
@echo "6. Verify command..."
@poetry run pytest tests/verify/ -v --tb=short || (echo "❌ Verify tests failed" && exit 1)
@poetry run python -m pillar.cli verify --json > /dev/null || (echo "❌ Verify command failed" && exit 1)
@echo "✓ Verify command passed"
@echo "7. Self-test command..."
@poetry run pytest tests/selftest/ -v --tb=short || (echo "❌ Self-test tests failed" && exit 1)
@poetry run python -m pillar.cli validate-self --json > /dev/null || (echo "❌ Validate-self command failed" && exit 1)
@echo "✓ Self-test command passed"
@echo "8. Bootstrap tests..."
@poetry run pytest tests/bootstrap/ -v --tb=short || (echo "❌ Bootstrap tests failed" && exit 1)
@echo "✓ Bootstrap tests passed"
@echo ""
@echo "✅ All CI checks passed locally!"
help:
@echo "Available targets:"
@echo " install - Install dependencies using Poetry"
@echo " test - Run all tests"
@echo " lint - Run linting checks"
@echo " format - Format code with black and ruff"
@echo " run-example - Run CLI with example fixture"
@echo " validate-structure - Validate required pillar files"
@echo " validate-spec - Validate docs/spec.yml via guardsuite-core"
@echo " validate-integrity - Assert docs/spec_integrity_matrix.md matches docs/spec.yml"
@echo " validate-contract - Enforce docs/template_contract.md requirements"
@echo " validate-quality - Run structure/spec integrity plus strict evaluator/CLI tests"
@echo " scaffold-dry-run - Preview files the scaffold script would create"
@echo " ci-local - Run all CI checks locally (simulates GitHub Actions pipeline)"