- Build:
cargo build --verbose - Test:
cargo test --verbose --all-features - Lint:
cargo clippy --verbose --all-features
- Use Rust 2024 edition
- Use
anyhow::Result<T>for all functions - Use
?operator for error propagation - Use
bail!()andanyhow!()for creating errors - Add comprehensive error documentation in function comments
- Group imports: std, external crates, local modules
- Use feature flags:
#[cfg(feature = "network")] - Prefer explicit imports over glob imports
- CLI: Use
clapwith derive macros for commands - Serialization: Use
serdewith YAML format - Documentation: Comprehensive doc comments with error descriptions
- Testing: Unit tests with
#[test]and#[cfg(test)]modules
- No unsafe code allowed
- Use path canonicalization for security
- Validate user inputs and paths
- Sign manifests with cryptographic keys
- Use temp directories for tests