codestyle

Crates.iocodestyle
lib.rscodestyle
version0.2.27
created_at2026-01-04 13:52:50.679206+00
updated_at2026-01-25 23:39:51.503839+00
descriptionA code style checker and formatter for Rust
homepage
repositoryhttps://github.com/valeratrades/codestyle
max_upload_size
id2021895
size244,577
Valeriy Sakharov (valeratrades)

documentation

README

codestyle

Minimum Supported Rust Version crates.io docs.rs Lines Of Code
ci errors ci warnings

A code style checker and formatter for Rust that enforces opinionated conventions beyond what rustfmt and clippy provide.

Installation

Cargo

cargo install codestyle

From source

git clone https://github.com/valeratrades/codestyle
cd codestyle
cargo install --path .

Usage

Basic usage

# Check for violations
codestyle rust assert ./my-project

# Auto-fix violations
codestyle rust format ./my-project

Check options

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

Available flags

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

Format mode will:

  1. Automatically fix violations where possible
  2. Delete any .snap and .pending-snap files (when insta check enabled)
  3. Report violations that require manual fixing
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

This repository follows my best practices and Tiger Style (except "proper capitalization for acronyms": (VsrState, not VSRState) and formatting). For project's architecture, see ARCHITECTURE.md.

License

Licensed under Blue Oak 1.0.0
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
Commit count: 87

cargo fmt