pub struct ConfigFile {Show 48 fields
pub gate: GateConfig,
pub max_depth: usize,
pub else_chain_threshold: usize,
pub max_params: usize,
pub max_function_body_lines: usize,
pub module_root_files: Arc<[Arc<str>]>,
pub source_file_warn_lines: usize,
pub source_file_deny_lines: usize,
pub max_methods: 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,
pub check_long_function_body: bool,
pub check_module_root_definitions: bool,
pub check_large_source_file: bool,
pub check_high_method_count: bool,
pub count_forwarders: bool,
pub check_item_visibility_policy: bool,
pub item_visibility_policy: Vec<ItemVisibilityRule>,
pub check_ungated_test_api: bool,
pub check_conflicting_module_root: bool,
pub test_api_patterns: Arc<[Arc<str>]>,
pub test_support_feature: Box<str>,
pub check_flat_module_family: bool,
pub flat_module_families: Vec<FlatModuleFamily>,
pub check_feature_boundary: bool,
pub feature_boundaries: Vec<FeatureBoundaryRule>,
pub check_scattered_inherent_impl: bool,
pub overrides: BTreeMap<Box<str>, PathOverride>,
}Expand description
Deserialized .pedant.toml file with all check settings.
Fields§
§gate: GateConfigSecurity gate rules configuration.
max_depth: usizeDepth limit for nesting checks (default: 3).
else_chain_threshold: usizeBranch count that triggers else-chain (default: 3).
max_params: usizeMaximum parameter count before high-param-count fires (default: 5).
max_function_body_lines: usizeBody line count before long-function-body fires (default: 120).
module_root_files: Arc<[Arc<str>]>File names treated as module roots by module-root-definitions
(default: mod.rs, lib.rs).
source_file_warn_lines: usizeLine count at which large-source-file emits a Warn (default: 500).
source_file_deny_lines: usizeLine count at which large-source-file emits a Deny (default: 1000).
max_methods: usizeInherent-method count before high-method-count fires (default: 40).
forbid_attributes: PatternCheckBanned attribute patterns (e.g., allow(dead_code)).
forbid_types: PatternCheckBanned type patterns (e.g., Arc<String>).
forbid_calls: PatternCheckBanned method call patterns (e.g., .unwrap()).
forbid_macros: PatternCheckBanned macro patterns (e.g., panic!).
check_naming: NamingCheckThresholds for the generic-naming check.
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>> anywhere.
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 SipHash hasher.
check_mixed_concerns: boolFlag disconnected type groups in a single file.
check_inline_tests: boolFlag #[cfg(test)] mod blocks embedded in source files.
check_let_underscore_result: boolFlag let _ = expr that discards a Result.
check_high_param_count: boolFlag functions with too many parameters.
check_long_function_body: boolFlag function bodies that exceed the line ceiling.
check_module_root_definitions: boolFlag item definitions in module-root files.
check_large_source_file: boolFlag source files that exceed the line ceiling.
check_high_method_count: boolFlag god-object types by inherent-method count.
count_forwarders: boolCount pure forwarders toward high-method-count.
check_item_visibility_policy: boolEnforce configured item-visibility policies.
item_visibility_policy: Vec<ItemVisibilityRule>Item-visibility policy rules.
check_ungated_test_api: boolFlag ungated test-only APIs under src/.
check_conflicting_module_root: boolFlag sibling <stem>.rs and <stem>/ module roots.
test_api_patterns: Arc<[Arc<str>]>Name globs that mark test-only APIs (default: *_for_tests).
test_support_feature: Box<str>Feature that must gate a test-only API (default: test-support).
check_flat_module_family: boolEnforce configured flat-module-family layout rules.
flat_module_families: Vec<FlatModuleFamily>Flat-module-family layout rules.
check_feature_boundary: boolEnforce configured Cargo feature-boundary invariants.
feature_boundaries: Vec<FeatureBoundaryRule>Cargo feature-boundary invariants.
check_scattered_inherent_impl: boolFlag types whose inherent impls span more than one file.
overrides: BTreeMap<Box<str>, PathOverride>Per-path configuration overrides keyed by glob pattern.
Trait Implementations§
Source§impl Debug for ConfigFile
impl Debug for ConfigFile
Source§impl Default for ConfigFile
impl Default for ConfigFile
Source§fn default() -> ConfigFile
fn default() -> ConfigFile
Source§impl<'de> Deserialize<'de> for ConfigFile
impl<'de> Deserialize<'de> for ConfigFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ConfigFile
impl RefUnwindSafe for ConfigFile
impl Send for ConfigFile
impl Sync for ConfigFile
impl Unpin for ConfigFile
impl UnsafeUnpin for ConfigFile
impl UnwindSafe for ConfigFile
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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