pub struct CheckConfig {Show 25 fields
pub max_depth: usize,
pub else_chain_threshold: usize,
pub max_params: usize,
pub forbid_attributes: PatternCheck,
pub forbid_types: PatternCheck,
pub forbid_calls: PatternCheck,
pub forbid_macros: PatternCheck,
pub check_naming: NamingCheck,
pub check_nested_if: bool,
pub check_if_in_match: bool,
pub check_nested_match: bool,
pub check_match_in_if: bool,
pub check_else_chain: bool,
pub forbid_else: bool,
pub forbid_unsafe: bool,
pub check_dyn_return: bool,
pub check_dyn_param: bool,
pub check_vec_box_dyn: bool,
pub check_dyn_field: bool,
pub check_clone_in_loop: bool,
pub check_default_hasher: bool,
pub check_mixed_concerns: bool,
pub check_inline_tests: bool,
pub check_let_underscore_result: bool,
pub check_high_param_count: bool,
}Expand description
Configuration controlling which checks are enabled and their thresholds.
Fields§
§max_depth: usizeMaximum allowed nesting depth.
else_chain_threshold: usizeMinimum branches to trigger else-chain.
max_params: usizeMaximum parameter count before high-param-count fires.
forbid_attributes: PatternCheckBanned attribute patterns.
forbid_types: PatternCheckBanned type patterns.
forbid_calls: PatternCheckBanned method call patterns.
forbid_macros: PatternCheckBanned macro patterns.
check_naming: NamingCheckGeneric naming check configuration.
check_nested_if: boolFlag if inside if.
check_if_in_match: boolFlag if inside match arm.
check_nested_match: boolFlag match inside match.
check_match_in_if: boolFlag match inside if branch.
check_else_chain: boolFlag long if/else if chains.
forbid_else: boolFlag any use of the else keyword.
forbid_unsafe: boolFlag any unsafe block.
check_dyn_return: boolFlag dynamic dispatch in return types.
check_dyn_param: boolFlag dynamic dispatch in function parameters.
check_vec_box_dyn: boolFlag Vec<Box<dyn T>>.
check_dyn_field: boolFlag dynamic dispatch in struct fields.
check_clone_in_loop: boolFlag .clone() inside loop bodies.
check_default_hasher: boolFlag HashMap/HashSet with default hasher.
check_mixed_concerns: boolFlag disconnected type groups in a single file.
check_inline_tests: boolFlag #[cfg(test)] mod blocks in source files.
check_let_underscore_result: boolFlag let _ = expr that discards a Result.
check_high_param_count: boolFlag functions with too many parameters.
Implementations§
Source§impl CheckConfig
impl CheckConfig
Sourcepub fn from_config_file(fc: &ConfigFile) -> Self
pub fn from_config_file(fc: &ConfigFile) -> Self
Build from a ConfigFile, copying all fields.
Sourcepub fn merge_bool_overrides(&mut self, ovr: &PathOverride)
pub fn merge_bool_overrides(&mut self, ovr: &PathOverride)
Apply Option<bool> overrides from a PathOverride.
Source§impl CheckConfig
impl CheckConfig
Sourcepub fn resolve_for_path<'a>(
&'a self,
file_path: &str,
file_config: Option<&ConfigFile>,
) -> Option<Cow<'a, Self>>
pub fn resolve_for_path<'a>( &'a self, file_path: &str, file_config: Option<&ConfigFile>, ) -> Option<Cow<'a, Self>>
Returns the effective config for a file path.
Borrows self when no overrides match (zero clones).
Clones and mutates only when a path override applies.
Returns None when the override disables analysis for this path.
Trait Implementations§
Source§impl Clone for CheckConfig
impl Clone for CheckConfig
Source§fn clone(&self) -> CheckConfig
fn clone(&self) -> CheckConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CheckConfig
impl Debug for CheckConfig
Auto Trait Implementations§
impl Freeze for CheckConfig
impl RefUnwindSafe for CheckConfig
impl Send for CheckConfig
impl Sync for CheckConfig
impl Unpin for CheckConfig
impl UnsafeUnpin for CheckConfig
impl UnwindSafe for CheckConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more