forked from KodeBarinn/kode-bridge
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
102 lines (87 loc) · 2.67 KB
/
Copy pathMakefile
File metadata and controls
102 lines (87 loc) · 2.67 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
# Production-grade Rust project management
.PHONY: check lint format test build clean doc doc-open help
# Default target
all: check
# Help target
help:
@echo "Available targets:"
@echo " check - Run all checks (lint + test + format-check)"
@echo " lint - Run Clippy with strict production settings"
@echo " format - Format code with rustfmt"
@echo " test - Run all tests"
@echo " build - Build in release mode"
@echo " clean - Clean build artifacts"
@echo " doc - Generate documentation"
# Comprehensive check for production
check: lint test format-check
@echo "✅ All production checks passed!"
# Strict linting for production
lint:
@echo "🔍 Running production-grade Clippy checks..."
cargo clippy --lib --tests --all-features -- \
-D warnings \
-D clippy::all \
-D clippy::correctness \
-D clippy::suspicious \
-D clippy::complexity \
-D clippy::perf \
-D clippy::style \
-A clippy::missing_docs_in_private_items \
-A clippy::missing_errors_doc \
-A clippy::missing_panics_doc \
-A clippy::module_name_repetitions \
-A clippy::similar_names \
-A clippy::too_many_lines \
-A clippy::multiple_crate_versions \
-A clippy::wildcard_dependencies \
-A clippy::must_use_candidate \
-A clippy::missing_const_for_fn \
-A clippy::significant_drop_tightening \
-A clippy::equatable_if_let \
-A clippy::missing_fields_in_debug \
-A clippy::unused_async
# Format code
format:
@echo "🎨 Formatting code..."
cargo fmt --all
# Check if code is formatted
format-check:
@echo "📝 Checking code formatting..."
cargo fmt --all -- --check
# Run tests with coverage information
test:
@echo "🧪 Running tests..."
cargo test --lib --all-features
@echo "📊 Running library tests specifically..."
cargo test --lib --quiet
# Build in release mode with optimization
build:
@echo "🏗️ Building release version..."
cargo build --release --all-features
# Clean build artifacts
clean:
@echo "🧹 Cleaning build artifacts..."
cargo clean
# Generate documentation
doc:
@echo "📚 Generating documentation..."
cargo doc --all-features --no-deps
# Generate and open documentation
doc-open:
@echo "📚 Generating documentation..."
cargo doc --all-features --no-deps --open
# Security audit
audit:
@echo "🔒 Running security audit..."
cargo audit
# Benchmark if available
bench:
@echo "⚡ Running benchmarks..."
cargo bench
# Check for unused dependencies
deps-check:
@echo "📦 Checking dependencies..."
cargo machete || echo "Install cargo-machete for dependency checking: cargo install cargo-machete"
# Full production pipeline
ci: lint test format-check build doc
@echo "🚀 Full CI pipeline completed successfully!"