Tidy rules
206 rules loaded from the same runtime registry and configuration used by cargo tidy.
Rust Ast (140)§
rust_alloc_ in_ loop - Flag
format!(),format_args!(),.to_string(), and.push_str()inside loops.
Severity: Medium rust_ambient_ syscall - Flag ambient I/O, clock, env, and entropy calls in library code.
Severity: Medium rust_asref_ bound_ on_ type - Flag struct/enum generic parameters bounded by
AsRef<…>and stored in fields.
Severity: Low rust_assert_ side_ effects - Ban compound assignments (
+=,-=) insidedebug_assert!macros.
Severity: High rust_assoc_ fn_ no_ self - Flag inherent associated fns that neither take nor return the impl type — make them free functions.
Severity: Low rust_async_ loop_ no_ yield - Flag loops in async contexts whose bodies never
.await(CPU-bound work without yield points).
Severity: Low rust_attr_ order - Require item attributes to be ordered as docs, derives, then other attributes.
Severity: Low · Auto-fixable rust_bool_ params - Flag functions with threshold+
boolparameters (error-prone API design).
Severity: Medium rust_build_ rs_ external_ tool - Flag build.rs usage of external tools, hard-required env vars, and build-time binding generation.
Severity: Medium rust_builder_ conventions - Enforce builder conventions: chainable by-value setters named
x(), a finalbuild(), andX::builder()instead ofXBuilder::new().
Severity: Medium rust_builder_ fallible_ setter - Flag builder setters returning
Result— setters accept infallibly, validation belongs inbuild().
Severity: Medium rust_builder_ param - Flag parameters typed
*Builder/*Factory— ask forimpl Fn() -> Tinstead.
Severity: Low rust_busy_ wait - Flag spin loops polling
try_recv/try_lock/atomics without sleeping, yielding, or blocking.
Severity: Medium rust_catch_ unwind - Require
// PANIC-BOUNDARY:comment oncatch_unwindcalls.
Severity: High rust_clone_ in_ loop - Flag
.clone()calls inside loop bodies (potential O(n) allocations).
Severity: Medium rust_closure_ dense_ method_ chain - Flag method-call chains containing at least the configured number of inline closure arguments.
Severity: Medium rust_closure_ param_ position - Flag closure parameters that are not last, and fns taking more than one closure.
Severity: Low rust_collection_ new_ in_ loop - Flag collection constructors (
Vec::new(),vec![],with_capacity, ...) bound vialetinside loops.
Severity: Medium rust_collection_ trait_ completeness - Require collection trait counterparts:
iter()needsimpl IntoIterator for &T,iter_mut()needsimpl IntoIterator for &mut T, andFromIterator/Extendcome in pairs.
Severity: Low rust_concrete_ io_ param - Flag fn parameters typed as concrete I/O handles like
FileorTcpStream.
Severity: Low rust_consecutive_ field_ asserts - Flag consecutive assertions on fields of the same receiver.
Severity: Low rust_const_ fn_ candidate - Flag pure functions that could be
const fn.
Severity: Low · Auto-fixable rust_const_ needs_ doc - Require a doc or line comment on private consts and statics holding literal values.
Severity: Low rust_conversion_ self_ convention - Enforce C-CONV receivers:
as_/to_methods borrow (&self),into_methods consume (self).
Severity: Medium rust_ctor_ new - Flag public structs with
Defaultbut nopub fn new— constructors are static inherent methods (C-CTOR).
Severity: Low rust_ctor_ param_ count - Flag constructors with too many parameters or runs of identically-typed primitives — cascade construction through helper types.
Severity: Medium rust_cyclomatic_ complexity - Flag functions with cyclomatic complexity > threshold.
Severity: Medium rust_dbg - Ban
dbg!()macro calls in production code.
Severity: Medium · Auto-fixable rust_deep_ exit - Ban
std::process::exit()in library code.
Severity: High rust_deeply_ nested_ types - Flag type annotations with > 3 levels of generic nesting.
Severity: Low rust_default_ hasher - Flag std
HashMap/HashSettypes and constructors that use the default SipHash hasher.
Severity: Low rust_derive_ order - Require traits inside derive attributes to be sorted alphabetically.
Severity: Low · Auto-fixable rust_dll_ boundary_ types - Flag
String,Vec,Box,dynobjects,TypeId, andInstantinextern "C"signatures.
Severity: High rust_doc_ errors_ section - Require a
# Errorssection on documented pub fns returningResult.
Severity: Medium rust_doc_ panics_ section - Require a
# Panicssection on documented pub fns that can panic.
Severity: Medium rust_drop_ panic - Ban
panic!,.unwrap(),.expect()insideimpl Drop.
Severity: High rust_dup_ expressions - Flag identical sub-expressions like
x == x,a - a,b && b.
Severity: High rust_dyn_ wrapper_ in_ api - Flag
Rc<dyn …>/Arc<dyn …>/Box<dyn …>in pub fn params, returns, and pub struct fields.
Severity: Low rust_error_ missing_ traits - Require
Displayandstd::error::Erroron public*Errortypes.
Severity: Medium rust_error_ type_ unit - Flag
Result<T, ()>return types — use a real error type.
Severity: Medium rust_excessive_ float_ precision - Flag float literals with more significant digits than the type can represent.
Severity: Low rust_exotic_ numeric_ api - Flag
Saturating/Wrapping/NonZero*in pub fn signatures.
Severity: Low rust_expect_ in_ result_ test - Disallow
expect_that!in tests returning Result.
Severity: Low rust_expect_ message - Require
.expect()to have a meaningful message, not generic ones.
Severity: Low rust_fallible_ in_ iterator - Flag
.unwrap()/.expect()inside iterator adapter closures.
Severity: Medium rust_ffi_ in_ core - Flag
#[no_mangle] extern "C"exports and#[repr(C)]raw-pointer structs in non-FFI crates.
Severity: Medium rust_ffi_ thin_ glue - Flag
extern "C"functions in*-fficrates whose body exceeds the line threshold.
Severity: Low rust_filesystem_ boundary - Require filesystem and native-path access to go through
wowlab-fs.
Severity: High rust_floating_ point_ eq - Flag direct
==/!=comparison onf32/f64values.
Severity: High rust_foreign_ reexports - Flag
pub usere-exports of items from foreign crates.
Severity: Medium rust_format_ in_ log - Flag runtime string building (
format!,.to_string(),{}placeholders) in logging macros.
Severity: Low rust_from_ instead_ of_ as - Flag
ascasts on suffixed literals — useFrom/Intoinstead.
Severity: Low · Auto-fixable rust_future_ send_ assert - Require a compile-time
Sendassertion for every explicitimpl Futurein the same file.
Severity: Low rust_getter_ prefix - Flag methods named
get_something— Rust getters are named after the field (C-GETTER).
Severity: Low rust_glob_ reexport - Flag
pub use foo::*glob re-exports outside platform-cfg'd HAL forwarding.
Severity: Medium rust_global_ state - Flag
staticitems with interior mutability and allthread_local!state.
Severity: Medium rust_gtest_ required - Require every native Rust test to use the googletest test attribute.
Severity: Medium rust_impl_ into_ for_ owned - Flag
impl Into<T> for X— implementFrom<X> for Tinstead (gives Into for free).
Severity: Medium rust_impl_ member_ order - Require inherent impl members to follow the canonical category and visibility order.
Severity: Medium · Auto-fixable rust_indexed_ element_ asserts - Flag consecutive assertions on indexed elements of the same collection.
Severity: Low rust_infallible_ from_ weak - Flag
impl From<weak>next to fallible construction of the same type.
Severity: Medium rust_inherent_ before_ trait_ impl - Require an inherent impl to precede trait impls for the same local type.
Severity: Low rust_inline_ test_ module_ size - Flag
#[cfg(test)] modblocks spanning more than threshold lines.
Severity: Low rust_large_ async_ local - Flag by-value
[T; N]locals and parameters over threshold bytes inside async fns and blocks.
Severity: Medium rust_large_ enum_ variant - Flag enum variants that are much larger than others (should Box the large variant).
Severity: Medium rust_large_ fn_ params - Flag functions with > threshold parameters.
Severity: Medium rust_large_ stack_ array - Flag large fixed-size arrays on the stack (>threshold bytes). WASM has limited stack.
Severity: High rust_log_ in_ loop - Flag logging macro invocations inside loop bodies in library code.
Severity: Low rust_long_ compound_ name - Flag type definitions whose CamelCase name compounds more than threshold words.
Severity: Low rust_loop_ to_ while - Flag
loop { if cond { break; } ... }— usewhileinstead.
Severity: Low rust_lossy_ cast - Flag
ascasts to types that lose precision (f32,u8,u16,i8,i16).
Severity: Medium rust_macro_ hidden_ items - Flag fixed-name
pubitems emitted from quote! bodies.
Severity: Medium rust_macro_ third_ party_ path - Flag absolute third-party paths in macro bodies and hardcoded host-crate paths in macro_rules!.
Severity: Medium rust_magic_ numbers - Flag unnamed numeric literals — extract into named constants.
Severity: Low rust_manual_ async_ fn - Flag non-async functions that return
impl Futureby wrapping the whole body in oneasyncblock.
Severity: Low rust_manual_ error_ impl - Reject hand-written
DisplayandErrorimplementations for*Errortypes.
Severity: Low rust_manual_ float_ epsilon - Disallow manual floating-point epsilon assertions and local assert-near helpers.
Severity: Medium rust_map_ err_ pure_ wrap - Flag
.map_err(...)that only wraps the error in another type — implementFromand let?convert.
Severity: Low rust_max_ fn_ lines - Flag functions longer than threshold lines.
Severity: Medium rust_max_ nesting - Flag nesting depth > threshold levels.
Severity: Medium rust_mem_ forget - Require
LEAKorSAFETYcomment onstd::mem::forget()calls.
Severity: High rust_missing_ assert_ message - Require a message argument on
assert!,assert_eq!,assert_ne!.
Severity: Low rust_missing_ capacity - Flag collections built with
new()/default()then grown inside a loop over a sized source.
Severity: Low rust_missing_ debug - Require
#[derive(Debug)]on public structs and enums.
Severity: Low · Auto-fixable rust_missing_ error_ context - Flag
.map_err(|_| ...)that discards the original error.
Severity: Medium rust_mod_ order - Require contiguous module-declaration blocks to be alphabetically sorted.
Severity: Low · Auto-fixable rust_module_ prefix_ in_ name - Flag pub type definitions whose name repeats the module name as a prefix (
FooIdinfoo.rs).
Severity: Low rust_multiple_ inherent_ impl - Flag multiple
impl Fooblocks for the same type in one file.
Severity: Low rust_mutex_ in_ async - Flag
std::sync::Mutexusage in async functions (use tokio::sync::Mutex).
Severity: High rust_native_ escape_ hatches - Require
unsafe fn from_native,into_native, andto_nativeon public raw-pointer wrapper structs.
Severity: Low rust_nested_ smart_ pointers - Flag directly nested heap pointers (
Arc<Box<T>>,Rc<Rc<T>>, ...) plusArc<Vec<T>>/Arc<String>.
Severity: Medium rust_newtype_ pub_ field - Flag pub single-field structs exposing a pub primitive/
&str/Stringfield.
Severity: Medium rust_non_ exhaustive_ on_ public - Flag public enums without
#[non_exhaustive]— prevents breaking changes when adding variants.
Severity: Medium rust_nonsend_ across_ await - Flag
Rc/RefCellbindings in async code when an.awaitoccurs later in the same block.
Severity: Medium rust_ok_ or_ eager - Flag
.ok_or()/.unwrap_or()with eagerly evaluated arguments.
Severity: Low · Auto-fixable rust_owned_ ref_ param - Flag fn parameters typed
&String,&PathBuf,&Vec<T>,&OsString.
Severity: Medium rust_padding - Require blank-line padding between distinct statement groups.
Severity: Low · Auto-fixable rust_panic - Ban
unimplemented!(),todo!(), and message-lesspanic!()in library code.
Severity: High rust_panic_ in_ result_ fn - Ban
panic!,.unwrap(),.expect()in functions returningResult.
Severity: High rust_panic_ message - Require a message on
unreachable!anddebug_assert!*.
Severity: Medium rust_param_ order_ consistency - Flag fns whose shared parameters appear in a different order than an earlier fn in the file.
Severity: Low rust_println - Ban
println!/eprintln!/print!/eprint!in library code.
Severity: Medium · Auto-fixable rust_proc_ macro_ thin_ shim - Require proc-macro entry points to be thin
impl_crate::name(arg.into()).into()shims.
Severity: Low rust_pub_ api_ docs - Require doc comments on public items.
Severity: Low rust_pub_ api_ foreign_ types - Flag foreign crate types leaked through
pubfn signatures, fields, and type aliases.
Severity: Low rust_pub_ api_ generic_ nesting - Flag pub fn signatures, pub struct fields, and pub type aliases nesting one local generic instantiation inside another (e.g.
Service<Backend<Store>>).
Severity: Low rust_pub_ api_ smart_ pointers - Flag
Rc/Arc/Box/RefCell/Cell/Mutex/RwLockas the outermost type of pub fn params, returns, and pub struct fields.
Severity: Medium rust_pub_ use_ grouping - Require public re-exports from the same origin to be adjacent.
Severity: Low · Auto-fixable rust_pub_ use_ position - Require top-level public imports to follow plain imports in a separate block.
Severity: Low · Auto-fixable rust_public_ error_ enum - Flag
pub enumnamed*Error/*ErrorKind— expose a situation-specific error struct with a private kind enum instead.
Severity: Medium rust_range_ over_ rangebounds - Flag
pubfn parameters typedRange<T>— acceptimpl RangeBounds<T>instead.
Severity: Low rust_raw_ rng - Flag raw
rng() < chancestochastic gating — useproc_chance(rng, chance).
Severity: Medium rust_raw_ spell_ id - Ban raw spell IDs and generated-constant re-aliases in spec hooks.
Severity: High rust_recursive_ fn - Flag direct self-recursion (stack overflow risk, especially in WASM).
Severity: High rust_redundant_ field_ names - Flag
Foo { x: x }— use shorthandFoo { x }instead.
Severity: Low · Auto-fixable rust_reinvented_ constant - Flag local constants that reinvent shared numeric constants.
Severity: Low rust_sensitive_ debug - Flag
#[derive(Debug)]on structs with sensitive fields likepassword.
Severity: High rust_single_ item_ path - Flag
pub usere-exports that duplicate paths already public through a siblingpub mod.
Severity: Medium rust_string_ error - Reject
Stringand&stras function error types.
Severity: Medium rust_subtractive_ feature_ cfg - Flag
#[cfg(not(feature = "..."))]onpubitems — features must be additive.
Severity: Medium rust_suspicious_ enum_ default - Flag
#[derive(Default)]on enums without explicit#[default]variant.
Severity: Medium rust_tautological_ assert - Flag test asserts comparing a constant against a literal (or literal vs literal).
Severity: Low rust_thiserror_ qualified - Require thiserror derives to use the qualified
thiserror::Errorpath.
Severity: Low · Auto-fixable rust_trait_ logic_ not_ inherent - Flag substantial logic in impls of locally-defined traits when the type has no same-named inherent method.
Severity: Low rust_transmute_ in_ safe_ fn - Flag
transmuteinside a safepubfn.
Severity: High rust_transmute_ usage - Require
SAFETYcomment onstd::mem::transmutecalls.
Severity: High rust_type_ def_ ordering - Flag
implblocks that appear before their type definition.
Severity: Low rust_unbalanced_ crate_ root - Flag
lib.rsroots that are flat item dumps (too many pub items) or empty shells (no pub items over many pub modules).
Severity: Low rust_unchecked_ indexing - Flag
container[expr]indexing with non-literal indices.
Severity: Low rust_unnecessary_ collect - Flag
.collect().iter()— remove the intermediate collection.
Severity: Low rust_unsafe_ comment - Require
// SAFETY:comment onunsafeblocks.
Severity: High rust_unsafe_ fn_ safety_ doc - Require a
# Safetydoc section or// SAFETY:comment on everyunsafe fn.
Severity: High rust_unsafe_ without_ ub_ surface - Flag
unsafe fnwith no raw-pointer surface and no unsafe operations in the body.
Severity: Low rust_unwrap_ in_ lib - Ban
.unwrap()in library code.
Severity: Medium rust_vec_ init_ then_ push - Flag
Vec::new()immediately followed by.push()calls (usevec![]orwith_capacity).
Severity: Low rust_vec_ string_ field - Flag non-pub struct fields typed
Vec<String>orVec<Vec<T>>.
Severity: Low rust_weasel_ words - Flag type definitions whose name contains a weasel word like
Manager,Service, orFactory.
Severity: Medium rust_where_ clauses - Require type-parameter trait bounds to use where clauses.
Severity: Low rust_wildcard_ imports - Ban
use foo::*outside tests and preludes.
Severity: Medium rust_yoda_ conditions - Flag reversed comparisons like
0 == x— preferx == 0.
Severity: Low
Rust Line (35)§
rust_abs_ home_ path - Ban hardcoded home directory paths like
/Users/or/home/in string literals.
Severity: Medium rust_aligned - Enforce column alignment in regions marked with
// #t:aligned.
Severity: Low · Auto-fixable rust_allow_ reason - Require a
reason = "..."or comment explaining why#[allow(...)]/#[expect(...)]is used.
Severity: Low rust_alphabetical - Enforce sorted ordering in regions marked with
tidy-alphabetical-start.
Severity: Low · Auto-fixable rust_ambiguous_ unicode - Ban Unicode characters visually confusable with ASCII (homoglyphs).
Severity: High rust_banner_ comments - Disallow decorative separator and framed banner comments.
Severity: Low · Auto-fixable rust_bidirectional_ unicode - Ban Unicode bidi control characters that enable trojan-source attacks.
Severity: High rust_box_ leak - Require
SAFETYorLEAKcomment onBox::leak()calls.
Severity: High rust_box_ vec - Ban
Box<Vec<T>>,Box<String>,Box<Box<T>>(unnecessary double indirection).
Severity: Medium · Auto-fixable rust_cfg_ not_ test - Flag
#[cfg(not(test))]— use dependency injection or feature flags instead.
Severity: Medium rust_comment_ space - Require a space after
//in comments (//bad->// good).
Severity: Low · Auto-fixable rust_commented_ code - Detect blocks of commented-out code (2+ consecutive lines).
Severity: Low rust_deny_ warnings - Ban
#![deny(warnings)]— breaks on compiler upgrades.
Severity: Medium · Auto-fixable rust_doc_ comment_ period - Require doc comments to end with proper punctuation.
Severity: Low rust_doc_ inline_ reexport - Require
#[doc(inline)]on local re-exports and forbid it on external ones.
Severity: Low rust_doc_ param_ table - Ban
# Parameters/# Arguments/# Paramssections in doc comments.
Severity: Low rust_docref - Validate
// docref:start/// docref:endcode-embed markers (pairing, ids, no blank lines inside).
Severity: High rust_duplicate_ words - Flag repeated words in comments like
the theoris is.
Severity: Low · Auto-fixable rust_expect_ over_ allow - Flag
#[allow(...)]in hand-written code — use#[expect(..., reason = "...")]instead.
Severity: Medium rust_ffi_ crate_ naming - Require
-ffinaming for crates exporting C symbols and-sysnaming for crates linking foreign C items.
Severity: Low rust_first_ doc_ sentence - Require the first doc sentence to end on the first line within a word budget.
Severity: Low rust_forbidden_ deps - Ban
std::netandstd::threadin WASM-targeted crates.
Severity: High rust_hardcoded_ url - Flag hardcoded URLs in source code (should use config/env).
Severity: Medium rust_imperative_ talent_ wiring - Require talent-gated config wiring to use declarative config rows.
Severity: Medium rust_log_ named_ events - Flag
event!(...)invocations without aname:argument before the level.
Severity: Low rust_module_ docs - Require
//!module docs at the top oflib.rsandmod.rsfiles.
Severity: Medium rust_no_ prelude - Ban
preludemodule declarations andprelude.rs/prelude/mod.rsfiles.
Severity: High rust_proc_ macro_ justification - Require a
// WHY-PROC:comment above every proc-macro attribute.
Severity: Medium rust_spec_ module_ layout - Enforce the minimum directory layout for engine-content spec hook modules, including
define_game_bug!placement inbugs.rs.
Severity: Medium rust_static_ mut - Ban
static mutdeclarations — useAtomicT,Mutex, orOnceLock.
Severity: High rust_style - Enforce no trailing whitespace, no tabs, no CRLF line endings.
Severity: Low · Auto-fixable rust_tidy_ directives - Enforce file-wide #t directives at top of file with a blank line separator.
Severity: Low rust_todo - Require TODO/FIXME/HACK/XXX to have parenthesized context.
Severity: Low rust_too_ many_ lines_ in_ file - Flag files exceeding threshold lines.
Severity: Medium rust_unsafe_ impl_ send - Flag
unsafe impl Send/Syncwithout a// SAFETY:comment, and any generic (blanket) form.
Severity: High
Rust Workspace (4)§
rust_duplicate_ strings - Find long string literals repeated across files; full-workspace runs are authoritative.
Severity: Low rust_param_ clump - Find maximal parameter groups repeated across functions; full-workspace runs are authoritative.
Severity: Low rust_similar_ fns - Find exact and near duplicate function bodies; full-workspace runs are authoritative.
Severity: Low rust_similar_ structs - Find exact, near, and containment duplicate named-field structs; full-workspace runs are authoritative.
Severity: Low
Toml (26)§
toml_ambiguous_ unicode - Ban Unicode characters in TOML that are visually confusable with ASCII.
Severity: High toml_cargo_ app_ error_ crates - Restrict application error crates to application crates and forbid mixing them.
Severity: Medium toml_cargo_ bench_ debug - Require [profile.bench] to enable debug info when any workspace member ships benchmarks.
Severity: Low toml_cargo_ crates_ in_ workspace - Require every crate directory to be a workspace member and ban
path = ...dependencies in member manifests.
Severity: Medium toml_cargo_ edition - Require the workspace and non-inheriting members to target at least the configured Rust edition, with the matching virtual-workspace resolver.
Severity: Medium toml_cargo_ feature_ names - Flag Cargo feature names with use-/with- prefixes or -support suffixes.
Severity: Low toml_cargo_ feature_ no_ std - Ban subtractive no-std Cargo features; provide an additive std feature instead.
Severity: Medium toml_cargo_ flat_ layout - Require every crate to be a direct child of crates/ and never nested inside another crate.
Severity: High toml_cargo_ mimalloc_ apps - Require binary crates to depend on mimalloc and install it as the global allocator.
Severity: Low toml_cargo_ msrv - Require the workspace to declare rust-version and members to inherit it instead of overriding it.
Severity: Low toml_cargo_ proc_ macro_ crate_ helper - Ban the proc-macro-crate helper dependency in Cargo manifests.
Severity: Low toml_cargo_ target_ cpu - Require a -C target-cpu rustflags entry in .cargo/config.toml for workspaces with native binaries.
Severity: Low toml_cargo_ tempfile_ dependency - Ban direct tempfile dependencies outside the shared filesystem implementation.
Severity: High toml_cargo_ workspace_ dep_ features - Flag [workspace.dependencies] entries that enable features outside the allowlist.
Severity: Low toml_cargo_ workspace_ inheritance - Require member crates to inherit dependency versions and shared package metadata from the workspace root.
Severity: Medium toml_cargo_ workspace_ lints - Require the workspace to enable the standard rust/clippy lint set and members to inherit it via
[lints] workspace = true.
Severity: Medium toml_manifest_ comment_ blocks - Require concise, single-line standalone comments in engine manifests.
Severity: Low · Auto-fixable toml_manifest_ field_ order - Require identity fields to appear first in manifest definition tables.
Severity: Low · Auto-fixable toml_manifest_ format - Require engine manifests to match the canonical Taplo format.
Severity: Low · Auto-fixable toml_manifest_ references - Require symbolic aura, spell, talent, and auto-attack references to resolve.
Severity: High toml_manifest_ repository - Require a closed, unambiguous manifest component graph and unique spec IDs.
Severity: High toml_manifest_ schema - Require every root manifest to compose and deserialize through the canonical schema.
Severity: High toml_manifest_ schema_ version - Require every root manifest to declare the current schema version explicitly.
Severity: High toml_manifest_ section_ contiguity - Require each top-level manifest section to occupy one contiguous region.
Severity: Medium toml_manifest_ shared_ anchors - Require shared includes to anchor every order-sensitive section they contribute.
Severity: High toml_validity - Reject TOML syntax errors and semantic conflicts such as duplicate keys.
Severity: High
Workspace (1)§
toml_cargo_ unused_ deps - Flag workspace-member dependencies that are never referenced by any Rust compile target.
Severity: Medium