cargo-oneway
One command that runs rustfmt, clippy, and oneway-lints (via dylint) against your Rust project with the Oneway lint set baked in. No copy-paste of config files into every project.
Install
Use
The first cargo oneway invocation triggers cargo dylint to clone the oneway-lints library from the upstream repo and build it under the pinned nightly. Subsequent runs use the dylint cache.
Opt-out per project: oneway.toml
Drop a oneway.toml at the project root to silence specific rules for that project:
= [
"type_derived_naming", # a dylint rule (from oneway-lints)
"clippy::wildcard_imports", # a clippy rule
]
The CLI routes entries by prefix: clippy::* are appended as -A clippy::<name> to the clippy invocation; everything else goes to dylint via RUSTFLAGS=-A <name>.
What it does
| Step | Tool | Config source |
|---|---|---|
| Format | cargo fmt |
templates/rustfmt.toml |
| General lints | cargo clippy |
templates/clippy.toml + a curated deny-list (see src/main.rs) |
| Oneway-specific lints | cargo dylint --lib oneway_lints |
From the lints/ sibling crate |
Why these clippy lints?
The deny-list in src/main.rs covers the Oneway lint suite's principles that clippy already handles natively — no point reimplementing what clippy does for free. See ../lints/README.md for the full picture.