This is the full category-by-category lint catalog for modum.
Use the README for the tool's thesis, quick usage, and configuration entry points. Use this document when you want the full reference surface in one place, or use modum --explain <code> for one diagnostic at a time.
These warn when imports or re-exports flatten a namespace that should stay visible.
namespace_flat_useWarning for flattened imports of generic nouns when there is an actionable namespace-visible call-site form that adds net context, such asstorage::Repositoryorhttp::StatusCode. It also covers family leaves when parsed source shows a clear local witness that the namespace still matters at call sites, such asviewer::ResolutionFlowalongsideviewer::ResolutionStateandviewer::ResolutionOutcome. It skips cases where the only preserved form would still be redundant, such aserror::Errororresponse::Response.namespace_flat_use_error_surface_follow_throughAdvisory warning for flattened imports that preserve an older flat*Errorpath even though parsed source now points at an owned or facetedErrorsurface instead, such asuser::EmailErrorwhen the family is really trying to move towarduser::email::Error, ormessage::BodyErrorwhen the real owner wantsmessage::body::Error.namespace_flat_use_child_facet_follow_throughAdvisory warning for flattened imports that preserve the broader owner path even though parsed source says the leaf family wants a deeper child facet, such asmessage::Bodywhen the real owner wants amessage::body::...surface.namespace_flat_use_preserve_moduleWarning for flattened imports from configured namespace-preserving modules when the preserved call-site form still adds net context.namespace_flat_use_redundant_leaf_contextWarning for flattened imports or actionable rename-heavy aliases whose leaf repeats parent context. For plain imports, this only fires when the shorter leaf would be an actionable generic noun such asRepository,Error, orId. For rename aliases, this only fires when the qualified form would still preserve real context, such ashttp::StatusCodeorpage::Event.namespace_redundant_qualified_genericWarning for qualified call-site paths whose module only repeats a generic category already named by the leaf, such asresponse::Responseorerror::Error. When the written path resolves through an imported namespace and a nearer parent surface would read better, it can recommend that promotable parent surface for owned code even if the export does not exist yet. It doesn't invent new parent surfaces for external crates such asstd,core,serde, oraxum.namespace_qualified_error_surface_follow_throughAdvisory warning for qualified paths that still spell the flatter*Errorsurface after ownership pressure has already established a better owned or facetedErrorpath, such asdomain::chat::message::BodyErrorwhen the family really wantsmessage::body::Error.namespace_qualified_child_facet_follow_throughAdvisory warning for qualified paths that still spell the broader owner path after ownership pressure has already established a deeper child facet, such asdomain::chat::message::Bodywhen the family really wants amessage::body::...surface.namespace_prelude_glob_importWarning foruse ...::prelude::*imports that hide the real source modules and flatten call-site context.namespace_glob_preserve_moduleWarning for glob imports from configured namespace-preserving modules such ashttp::*, when the import erases context the module name should carry at call sites.namespace_family_unsupported_constructAdvisory warning for imports, re-exports, or type aliases where namespace-family call-site inference was skipped because the parsed source includes unsupported observation gaps such as#[cfg],macro_rules!, other item macros, orinclude!.namespace_parent_surfacenamespace_flat_pub_usenamespace_flat_pub_use_error_surface_follow_throughnamespace_flat_pub_use_child_facet_follow_throughnamespace_flat_pub_use_preserve_modulenamespace_flat_pub_use_redundant_leaf_contextnamespace_flat_type_alias_error_surface_follow_throughnamespace_flat_type_alias_child_facet_follow_through
Examples:
use storage::Repository;use http::Client;use user::UserRepository;use crate::user::EmailError;use crate::chat::message::Body;type DecodeBody = crate::chat::message::BodyError;type BodyValue = crate::chat::message::Body;domain::chat::message::BodyErrordomain::chat::message::Bodyresponse::Responseuse crate::error::Error;inside a crate whose root surface already exposesErrorpub use auth::{login, logout};use http::prelude::*;use http::*;
Canonical parent-surface re-exports are allowed. pub use error::{Error, Result}; is valid when that is how a module intentionally exposes module::Error and module::Result. The same applies to broader UI surfaces such as exposing both components::Button and partials::Button.
A semantic child module namespace can also stay flat when it is already doing the call-site naming work. For example, use components::tab_set; with call sites like tab_set::ContentProps should not be forced into components::tab_set::ContentProps.
These warn when public leaves are too generic for a weak parent, when the path repeats context it already has, or when a flat family suggests a semantic module surface.
For these surface-shape rules, shared crate-visible surfaces such as pub(crate) items and re-exports are treated the same way as fully public ones.
api_missing_parent_surface_exportWarning for public child modules that should also surface a readable parent alias, such ascomponents::Buttonovercomponents::button::Button, oroutcome::Toxicityoveroutcome::toxicity::Outcome.api_weak_module_generic_leafapi_redundant_leaf_contextWarning for public leaves that repeat semantic module context already carried by the path, such asuser::UserRepository, or that bake a sibling semantic module into a flat public leaf whenuser::Repositoryalready exists.api_candidate_semantic_moduleAdvisory warning for public item families that suggest a semantic module surface, either through a shared head across at least three siblings likeUserRepository,UserService, andUserId, through select 2-member high-signal pairs likeTransactionIdplusTransactionFailureorHttpRequestplusHttpResponse, through a shared head plus tail that points to a nested surface likecase::launch::{Inbox, Detail, Audit}, or through a shared generic tail likeCompletedOutcome,RejectedOutcome, andtoxicity::Outcome. It works on parsed source only and doesn't see macro expansion or cfg-pruned items.api_candidate_facet_moduleAdvisory warning for root modules that flatten several leaf value-plus-error families next to a broader rootError, such asuser::{Email, EmailError, Username, UsernameError, Error}. It points toward owned facets likeuser::emailanduser::username, with the root keeping the cross-facet boundary.api_candidate_child_facet_moduleAdvisory warning for broader public modules that appear to want one deeper child facet for a validated leaf and its failure surface, such aschat::messagewantingchat::message::bodyorchat::moderationwantingchat::moderation::reason. It is meant for modules that already expose aggregate items likeMessage,Item, orQueue, but still keep the validated leaf flat at the same level.api_boundary_wraps_child_facet_errorAdvisory warning for broader publicErrorboundaries that still wrap a flat child companion error likemessage::BodyErrorormoderation::ReasonErroreven though the corresponding child module already looks like it wants a deeper owner such asmessage::bodyormoderation::reason. It points toward letting the broader boundary wrapmessage::body::Errorormoderation::reason::Erroronce that child facet exists.api_owned_facet_companion_errorAdvisory warning for already-owned public facets that define a localErrorand also rely on a same-leaf companion failure likeTextErrorfor a local tuple-wrapper leaf such asText. It points toward one canonical facet-local failure surface likeroom::name::Errorinstead of exporting bothTextErrorandErrorfrom the same owner.api_candidate_semantic_module_unsupported_constructAdvisory warning for scopes where semantic-module family inference was skipped because the parsed source includes unsupported observation gaps such as#[cfg],macro_rules!, other item macros, orinclude!.api_manual_enum_string_helperAdvisory warning for public enum string surfaces that are spelled manually, including bespoke non-const methods such aslabel()oras_str(), free helpers such asscenario_label(&Scenario), and manualDisplayimpls that only map variants to string literals.api_ad_hoc_parse_helperAdvisory warning for public enum parse helpers, including freeparse_*functions and inherent methods such asMode::parse(&str) -> Result<Self, _>, whenFromStrorTryFrom<&str>would be a better standard boundary.api_parallel_enum_metadata_helperAdvisory warning for public enums that expose several parallel metadata helpers likelabel(),code(), andsource_term()over repeatedmatch selfblocks, when a typed descriptor surface would model that metadata more cleanly.api_strum_serialize_all_candidateWarning for per-variantstrumstring attributes that could be replaced by one enum-levelserialize_allrule without changing the external strings.api_builder_candidateWarning for public constructors or workflow entrypoints that take several positional weak parameters and would read better as a builder or typed options struct. It skips functions already marked with a builder surface.api_repeated_parameter_clusterWarning for repeated public constructor or workflow signatures that reuse the same ordered named parameter cluster across entrypoints, when a shared options type orbonbuilder would avoid duplicating the call shape.api_optional_parameter_builderWarning for builder-shaped public entrypoints that take positionalOption<_>parameters and would read better as abonbuilder, so callers can omit unset values instead of passingNone.api_defaulted_optional_parameterWarning for builder-shaped public entrypoints that immediately default positionalOption<_>parameters, when abonbuilder would let callers omit those values entirely.callsite_maybe_someAdvisory warning formaybe_*method calls that passSome(...)directly, which usually defeats the point of having pairedx(...)andmaybe_x(...)builder setters.api_standalone_builder_surfaceAdvisory warning for families of publicwith_*orset_*free functions that collectively behave like a builder surface for one type.api_boolean_protocol_decisionWarning for publicboolparameters or fields that encode a domain or protocol decision rather than a runtime toggle.api_forwarding_compat_wrapperWarning for explicit conversion helpers such asto_*orinto_*methods that only forward to an existingFromconversion already present in the crate.api_stringly_protocol_collectionAdvisory warning for public const or static collections that enumerate protocol, state, transition, artifact, gate, or step values as raw strings instead of typed enums or descriptor maps.api_stringly_model_scaffoldAdvisory warning for public structs that carry several semantic descriptor fields as raw strings, such asstate_path,kind_label, andnext_machine, when those concepts would read better as typed enums, newtypes, or a focused descriptor type.api_redundant_category_suffix
Examples:
UserRepository,UserService,UserIduser::{Email, EmailError, Username, UsernameError, Error}chat::message::{Body, Message}when the error surface really wantschat::message::body::{Body, Error}chat::Error::MessageBody { source: message::BodyError }when the child owner really wantschat::message::body::Errorroom::name::{Text, Error}with a companionTextErrorCompletedOutcome,RejectedOutcome,toxicity::OutcomeUserRepositorywhenuser::Repositoryalready existspartials::button::Buttonwhen the intended surface should also exposepartials::Buttonoutcome::toxicity::Outcomewhen the intended surface should also exposeoutcome::Toxicitystorage::Repositoryuser::UserRepositoryuser::error::InvalidEmailError
Private organizational child modules are allowed to flatten their family items back to the parent surface. For example, mod auth_shell; pub use auth_shell::{AuthShell, AuthShellVariant}; is treated as a valid parent-surface export shape.
These advisories push caller-facing types and signatures away from raw strings, raw integers, raw key-value bags, manual flag bits, and catch-all error surfaces.
api_anyhow_error_surfaceAdvisory warning for public or shared surfaces that exposeanyhow::Errororanyhow::Resultinstead of a crate-owned typed error boundary.api_string_error_surfaceAdvisory warning for public or shared surfaces that returnResult<_, String>or store error text in raw string fields.api_manual_error_surfaceAdvisory warning for public error types that manually expose bothDisplayandError, when the boundary may want a smaller focused error surface instead of more formatting boilerplate.api_semantic_string_scalarAdvisory warning for caller-facing names likeemail,url,path,locale, orcurrencywhen they stay rawStringor&str.api_semantic_numeric_scalarAdvisory warning for caller-facing names likeduration,timestamp, orportwhen they stay raw primitive integers.api_raw_key_value_bagAdvisory warning for caller-facingHashMap<String, String>,BTreeMap<String, String>, orVec<(String, String)>bags such asmetadata,headers,params, ortags.api_boolean_flag_clusterAdvisory warning for public structs or entrypoints that carry several booleans which jointly shape behavior.api_integer_protocol_parameterAdvisory warning for protocol-like names such asstatus,kind,mode, orphasewhen they stay raw integers.api_raw_id_surfaceAdvisory warning for raw id aliases, fields, parameters, or returns such asUserId = Stringorrequest_id: u64.api_manual_flag_setAdvisory warning for parallel publicFLAG_*integer constants, rawflagsandpermissionsbit-mask boundaries, or repeated named bitmask checks and assembly in caller-facing code that suggest a typed flags surface.
These catch weak or redundant public module structure.
api_catch_all_moduleapi_repeated_module_segmentapi_path_shim_moduleWarning for surface-visible#[path = ...] mod ...;shims when the attribute is being used to keep an older filesystem layout under a nicer module path. If the public path wantsrequest_meta, create a realrequest_metamodule file or directory instead of mountingrequest_meta_flow.rsthrough#[path].internal_path_shim_moduleWarning for internal#[path = ...] mod ...;shims when the attribute is being used to fake a semantic module layout, such asflow::room::createmounted from../create_room_flow.rs. If the structure wants that module, move or rename the files so the filesystem matches the namespace.
Examples:
helperserror::error#[path = "request_meta_flow.rs"] mod request_meta;#[path = "../create_room_flow.rs"] mod create;
This rule is an error, not a warning.
api_organizational_submodule_flatten
Example:
partials::error::Errorshould usually bepartials::Errorresponse::Responseshould usually beResponse