| Crates.io | codestyle |
| lib.rs | codestyle |
| version | 0.2.27 |
| created_at | 2026-01-04 13:52:50.679206+00 |
| updated_at | 2026-01-25 23:39:51.503839+00 |
| description | A code style checker and formatter for Rust |
| homepage | |
| repository | https://github.com/valeratrades/codestyle |
| max_upload_size | |
| id | 2021895 |
| size | 244,577 |
A code style checker and formatter for Rust that enforces opinionated conventions beyond what rustfmt and clippy provide.
cargo install codestyle
git clone https://github.com/valeratrades/codestyle
cd codestyle
cargo install --path .
# Check for violations
codestyle rust assert ./my-project
# Auto-fix violations
codestyle rust format ./my-project
Each check can be enabled or disabled with --<check>=true|false:
# Enable instrument check (off by default)
codestyle rust --instrument=true assert ./my-project
# Disable specific checks
codestyle rust --loops=false --embed-simple-vars=false assert ./my-project
| Flag | Default | Description |
|---|---|---|
--instrument |
false | Check async functions for #[instrument] |
--loops |
true | Check endless loops for //LOOP comments |
--impl-follows-type |
true | Check impl blocks follow type definitions |
--embed-simple-vars |
true | Check format strings embed simple variables |
--insta-inline-snapshot |
true | Check insta macros use inline snapshots |
Format mode will:
.snap and .pending-snap files (when insta check enabled)codestyle rust format ./my-project
# codestyle: fixed 3 violation(s)
# codestyle: 1 violation(s) need manual fixing:
# [loops] src/main.rs:42:5: Endless loop without //LOOP comment