Contributor Setup
Prerequisites
- Rust stable (1.85+, edition 2024)
cargo-nextestfor test executioncargo-clippyfor linting (included with rustup)
Clone and build
git clone https://github.com/randomvariable/synwire.git
cd synwire
cargo build --workspace
Run tests
# All tests (recommended)
cargo nextest run --workspace --all-features
# Doctests (nextest does not run these)
cargo test --workspace --doc
# Single crate
cargo nextest run -p synwire-core
Linting
# Clippy with workspace lints (must pass with zero warnings)
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Format check
cargo fmt --all -- --check
Documentation
# Build rustdoc
cargo doc --workspace --no-deps --all-features
# Check for doc warnings
cargo doc --workspace --no-deps 2>&1 | grep -c warning
Workspace lints
The workspace enforces strict lints via Cargo.toml:
clippy::pedanticandclippy::nurseryat warn levelclippy::unwrap_used,clippy::expect_used,clippy::panic,clippy::todoare deniedmissing_docsis denied -- all public items must have doc commentsunsafe_codeis denied across all crates
Adding a new crate
- Create the crate directory under
crates/ - Add it to the workspace
membersin the rootCargo.toml - Add
[lints] workspace = trueto inherit workspace lints - Add
#![deny(unsafe_code)]or#![forbid(unsafe_code)]tolib.rs - Add
//!module-level documentation tolib.rs
Pull request checklist
-
cargo fmt --allpasses -
cargo clippy --workspace --all-targets --all-features -- -D warningspasses -
cargo nextest run --workspace --all-featurespasses -
cargo test --workspace --docpasses - New public items have doc comments
-
No
unsafecode unless justified and documented - No new dependencies without discussion