Skip to content

Almaju/oneway-lints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oneway-lints

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.

Status

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.

Quickstart

cargo install cargo-dylint dylint-link
cargo install cargo-oneway
cargo oneway

The 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.

Documentation

  • 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).

Repository Layout

Path Description
cli/ The cargo-oneway binary, published to crates.io.
lints/ The dylint cdylib (oneway_lints). Pinned to a specific nightly.

Contributing

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 .githooks

The 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.

Releases

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.

License

Dual-licensed under MIT or Apache-2.0.

About

Opinionated Rust lint suite — one command runs rustfmt + clippy + dylint with the Oneway lint set

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages