-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
115 lines (90 loc) · 3.43 KB
/
Copy pathMakefile
File metadata and controls
115 lines (90 loc) · 3.43 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
SHELL := /usr/bin/env bash
.DEFAULT_GOAL := ci
# ─── Rust ────────────────────────────────────────────────────────────────────
RUST_PACKAGES := bugswarm-sandbox bugswarm-evidence bugswarm-cpg bugswarm-symbolic
CARGO_FLAGS ?=
.PHONY: cargo-check
cargo-check:
@echo "── cargo check ──"
cargo check --workspace --all-features $(CARGO_FLAGS)
.PHONY: cargo-clippy
cargo-clippy:
@echo "── cargo clippy ──"
cargo clippy --all -- -D warnings $(CARGO_FLAGS)
.PHONY: cargo-test
cargo-test:
@echo "── cargo test ──"
cargo test --workspace $(CARGO_FLAGS)
.PHONY: cargo-audit
cargo-audit:
@echo "── cargo audit ──"
cargo audit $(CARGO_FLAGS)
.PHONY: cargo-fmt
cargo-fmt:
@echo "── cargo fmt ──"
cargo fmt --check $(CARGO_FLAGS)
.PHONY: safety-comments
safety-comments:
@echo "── SAFETY comments check ──"
bash bugswarm-sandbox/ci/check_safety_comments.sh
@echo "SAFETY check passed"
# ─── Python ──────────────────────────────────────────────────────────────────
.PHONY: ruff-check
ruff-check:
@echo "── ruff check ──"
ruff check --output-format=concise .
@echo "ruff check passed"
.PHONY: ruff-format
ruff-format:
@echo "── ruff format ──"
ruff format --check .
@echo "ruff format passed"
.PHONY: mypy
mypy:
@echo "── mypy ──"
mypy --strict --ignore-missing-imports bugswarm_mini/ bugswarm-gateway/src/gateway/ bugswarm-agent/src/agent/ bugswarm-swarm/src/swarm/
@echo "mypy passed"
.PHONY: pytest
pytest:
@echo "── pytest ──"
python3 -m pytest tests/ -q --tb=short
@echo "pytest passed"
.PHONY: secrets-test
secrets-test:
@echo "── secrets unit tests ──"
python3 -m pytest tests/unit/test_secrets.py -q
@echo "secrets tests passed"
# ─── Pre-commit ──────────────────────────────────────────────────────────────
.PHONY: pre-commit-install
pre-commit-install:
@echo "── installing pre-commit hooks ──"
pre-commit install
pre-commit install --hook-type pre-push
@echo "pre-commit hooks installed"
.PHONY: pre-commit-run
pre-commit-run:
@echo "── running pre-commit on all files ──"
pre-commit run --all-files
@echo "pre-commit passed"
# ─── Composite targets ───────────────────────────────────────────────────────
.PHONY: lint
lint: cargo-clippy ruff-check ruff-format safety-comments
.PHONY: typecheck
typecheck: mypy
.PHONY: test
test: cargo-test pytest secrets-test
.PHONY: audit
audit: cargo-audit cargo-fmt
.PHONY: ci
ci: cargo-check lint typecheck test audit
@echo ""
@echo "═══════════════════════════════════════════════════════"
@echo " ALL CHECKS PASSED"
@echo "═══════════════════════════════════════════════════════"
.PHONY: all
all: ci
.PHONY: fix
fix:
ruff check --fix .
ruff format .
cargo fmt