An opinionated lint suite for Rust. One command — cargo oneway — runs rustfmt, clippy (with the Oneway config), and a custom dylint library against your project. No copy-paste of config files into every repo.
The philosophy: there is one way to do it. Sorting is canonical, comments must justify themselves, raw primitives are wrapped, public methods don't compose other public methods, and so on.
Personal project, opinionated by design. Bus factor is 1 — every commit to main auto-publishes to crates.io, so version numbers churn and there's no review process. Shared in case it's useful; not seeking adopters or contributors. If you try it and have feedback, an issue is welcome.
cargo install cargo-dylint dylint-link
cargo install cargo-oneway
cargo onewayThe first cargo oneway invocation pulls the pinned nightly toolchain + rustc-dev + llvm-tools-preview components (a few hundred MB) and builds the lint library at the matching git tag. Takes a few minutes; subsequent runs use the dylint cache.
The dylint dependency means nightly Rust is required — there's no stable path that gives you AST access at the level these rules need.
cli/README.md— how to use the CLI: every subcommand, flags,oneway.toml, environment, version coupling.lints/README.md— every rule, grouped by category, with severities and links to per-rule rationale + examples.lints/docs/— one Markdown page per rule with bad/good examples.CHANGELOG.md— what changed in each version (the rules churn occasionally).
| Path | Description |
|---|---|
cli/ |
The cargo-oneway binary, published to crates.io. |
lints/ |
The dylint cdylib (oneway_lints). Pinned to a specific nightly. |
A pre-push hook in .githooks/ runs cargo oneway against both crates before letting a push through. Enable it once per clone:
git config core.hooksPath .githooksThe hook uses your local lints/ checkout (via ONEWAY_LINTS_PATH), so it lints against the rules you're actually committing. Bypass with git push --no-verify if you need to.
There's also a justfile recipe: just oneway runs the same checks across both crates.
cargo-oneway ships on every push to main: the release workflow bumps the patch version, commits and tags the bump, pushes the vX.Y.Z tag, then publishes to crates.io.
The CLI version pins the lint library. Each published cargo-oneway binary embeds its own version and asks cargo dylint for the matching git tag (--tag vX.Y.Z). So cargo install cargo-oneway --version 0.1.5 gives you exactly the rules that shipped with v0.1.5 — not whatever happens to be on main today. Updating the rules means updating the CLI: cargo oneway update.
Dual-licensed under MIT or Apache-2.0.