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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# Justfile for search-sdk-rust
# A modern alternative to Makefile using the `just` command runner
# Default recipe to display help
default:
@just --list
# Build the project
build:
cargo build
# Build in release mode
build-release:
cargo build --release
# Run all tests
test:
cargo test
# Run only unit tests (lib tests)
test-unit:
cargo test --lib
# Run only integration tests
test-integration:
cargo test --test integration_tests
# Run all tests with verbose output and debug logging
test-all:
RUST_LOG=debug cargo test --all-features --verbose
# Run tests with coverage (requires cargo-tarpaulin)
test-coverage:
cargo tarpaulin --out Html --output-dir coverage
# Format code
fmt:
cargo fmt
# Check formatting without applying changes
fmt-check:
cargo fmt -- --check
# Run clippy linter
lint:
cargo clippy -- -D warnings
# Fix linting issues automatically
lint-fix:
cargo clippy --fix --allow-dirty
# Check code without building
check:
cargo check
# Check all targets and features
check-all:
cargo check --all-targets --all-features
# Generate and open documentation
doc:
cargo doc --no-deps --open
# Generate documentation including private items
doc-private:
cargo doc --no-deps --document-private-items --open
# Run benchmarks
bench:
cargo bench
# Install the binary
install:
cargo install --path .
# Run the main binary
run *args:
cargo run {{args}}
# Run in release mode
run-release *args:
cargo run --release {{args}}
# Clean build artifacts
clean:
cargo clean
# Setup development environment
dev-setup:
rustup component add rustfmt clippy
@echo "Development tools installed"
# Run all development checks
dev-check:
just fmt-check
just lint
just check
just test
@echo "All development checks passed!"
# Run CI/CD pipeline
ci:
just fmt-check
just lint
just check-all
just test-all
@echo "CI pipeline completed successfully"
# Run performance tests
perf-test:
@echo "Running performance tests..."
cargo test --release --test integration_tests test_large_number_of_results -- --nocapture
cargo test --release --test integration_tests test_memory_usage_with_large_content -- --nocapture
# Security audit
audit:
cargo audit
# Update dependencies
update:
cargo update
# Show outdated dependencies
outdated:
cargo outdated
# Watch for changes and run tests
watch-test:
cargo watch -x test
# Watch for changes and run specific test
watch-test-name name:
cargo watch -x "test {{name}}"
# Quick development cycle: format, check, test
quick:
just fmt
just check
just test-unit
# Create a new example
new-example name:
@echo 'use search_sdk::*;\n\nfn main() {\n println!("Example: {{name}}");\n}' > examples/{{name}}.rs
@echo "Created examples/{{name}}.rs"
# Run a specific example
example name:
cargo run --example {{name}}
# Generate test coverage report
coverage:
#!/usr/bin/env bash
if command -v cargo-tarpaulin &> /dev/null; then
cargo tarpaulin --out Html --output-dir coverage
@echo "Coverage report generated in coverage/"
else
@echo "cargo-tarpaulin not found. Install with: cargo install cargo-tarpaulin"
fi
# Profile the application
profile:
cargo build --release
@echo "Run with profiler: perf record -g target/release/search-sdk-rust"
# Memory check with valgrind (Linux only)
valgrind:
cargo build
valgrind --tool=memcheck --leak-check=full target/debug/search-sdk-rust