Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
106 lines (81 loc) · 2.64 KB
/
Copy pathMakefile
File metadata and controls
106 lines (81 loc) · 2.64 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
.PHONY: all build check test test-all test-integration test-integration-unix test-integration-tls fmt clippy doc deny clean setup-hooks coverage coverage-lcov coverage-policy-test
include .config/coverage.env
# Default: full check cycle
all: fmt clippy test doc
# Build
build:
cargo build --workspace --all-features
# Quick check (no codegen)
check:
cargo check --workspace --all-features
# Run unit tests
test:
cargo test --workspace
# Run all tests including integration and feature-gated
test-all:
cargo test --workspace --all-features
# Run the python-gvm integration tests against the standalone mock server
test-integration: test-integration-unix test-integration-tls
test-integration-unix:
python3 tests/integration/test_python_gvm.py
test-integration-tls:
python3 tests/integration/test_python_gvm_tls.py
# Format code
fmt:
cargo fmt --all
# Format check (CI)
fmt-check:
cargo fmt --all -- --check
# Lint
clippy:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Documentation (with warnings as errors)
doc:
RUSTDOCFLAGS="-Dwarnings" cargo doc --workspace --all-features --no-deps
# Open docs in browser
doc-open:
RUSTDOCFLAGS="-Dwarnings" cargo doc --workspace --all-features --no-deps --open
# License/advisory check
deny:
cargo deny check
# Coverage report
coverage:
cargo llvm-cov --workspace --all-features --html
@echo "Report: target/llvm-cov/html/index.html"
# Coverage (lcov for CI)
coverage-lcov:
cargo llvm-cov --workspace --all-features --fail-under-lines $(RUST_COVERAGE_FLOOR) --lcov --output-path lcov.info
cargo llvm-cov report --summary-only --json --output-path rust-coverage-summary.json
# Controlled proof that the threshold comparison rejects a regression.
coverage-policy-test:
scripts/test_coverage_threshold.sh
# Install pre-commit hooks
setup-hooks:
@command -v pre-commit >/dev/null 2>&1 || { echo "Install pre-commit: pip install pre-commit"; exit 1; }
pre-commit install
pre-commit install --hook-type commit-msg
pre-commit install --hook-type pre-push
@echo "Hooks installed: pre-commit (fmt+clippy), commit-msg (conventional), pre-push (test+doc)"
# Install development tools
setup-tools:
cargo install cargo-deny
cargo install cargo-llvm-cov
cargo install cargo-audit
cargo install cargo-outdated
cargo install cargo-machete
@echo "Dev tools installed."
# Audit dependencies for vulnerabilities
audit:
cargo audit
# Check for outdated dependencies
outdated:
cargo outdated --workspace
# Check for unused dependencies
machete:
cargo machete
# Clean build artifacts
clean:
cargo clean
# Full CI simulation locally
ci: fmt-check clippy test-all doc deny
@echo "All CI checks passed."