Rust
Rust is a systems programming language focused on safety, concurrency, and performance. LumenFlow’s rust preset integrates with Cargo for comprehensive quality gates.
Quickstart
Section titled “Quickstart”-
Add preset to your configuration
-
Run gates
-
Done!
The preset runs
cargo fmt,cargo clippy,cargo check, andcargo testautomatically.
Preset Defaults
Section titled “Preset Defaults”The rust preset uses these commands:
| Gate | Command | Description |
|---|---|---|
| Format | cargo fmt --check | Check code formatting |
| Lint | cargo clippy | Catch common mistakes and improve code |
| Typecheck | cargo check | Fast type checking without full build |
| Test | cargo test | Run all tests |
Custom Configuration
Section titled “Custom Configuration”Override specific commands while keeping preset defaults for others:
Full Custom Configuration
Section titled “Full Custom Configuration”For complete control, omit the preset and define all commands:
Common Patterns
Section titled “Common Patterns”Strict Clippy
Section titled “Strict Clippy”Treat all Clippy warnings as errors:
Configure additional lints in Cargo.toml:
With Coverage
Section titled “With Coverage”Add test coverage using cargo-tarpaulin:
Or using cargo-llvm-cov:
All Features and Targets
Section titled “All Features and Targets”Ensure all features and targets compile:
With Documentation
Section titled “With Documentation”Include documentation build in gates:
GitHub Action Example
Section titled “GitHub Action Example”Project Structure
Section titled “Project Structure”LumenFlow works well with standard Cargo project layouts:
Workspace Support
Section titled “Workspace Support”For Cargo workspaces, LumenFlow runs gates across all crates:
Example workspace structure:
Nightly Features
Section titled “Nightly Features”If using nightly-only features:
In CI, install the nightly toolchain:
Troubleshooting
Section titled “Troubleshooting”Clippy warnings in dependencies
Section titled “Clippy warnings in dependencies”Filter to your code only:
Long compile times in CI
Section titled “Long compile times in CI”Use caching and consider splitting jobs:
Feature flag combinations
Section titled “Feature flag combinations”Test specific feature combinations:
Cross-compilation
Section titled “Cross-compilation”For cross-compilation targets, add the target in CI:
Next Steps
Section titled “Next Steps”- Gates Concepts - Understanding gates
- Configuration Reference - Full config schema
- GitHub Action - CI/CD integration