pub struct DclintConfig {
pub rules: HashMap<String, RuleConfig>,
pub quiet: bool,
pub debug: bool,
pub exclude: Vec<String>,
pub threshold: Severity,
pub disable_ignore_pragma: bool,
pub fixable_only: bool,
}Expand description
Main configuration for dclint.
Fields§
§rules: HashMap<String, RuleConfig>Per-rule configuration.
quiet: boolSuppress non-error output.
debug: boolEnable debug output.
exclude: Vec<String>File patterns to exclude from linting.
threshold: SeverityMinimum severity threshold for reporting.
disable_ignore_pragma: boolWhether to disable pragma (comment-based) ignores.
fixable_only: boolWhether to report fixable issues only.
Implementations§
Source§impl DclintConfig
impl DclintConfig
Sourcepub fn with_quiet(self, quiet: bool) -> Self
pub fn with_quiet(self, quiet: bool) -> Self
Set quiet mode.
Sourcepub fn with_debug(self, debug: bool) -> Self
pub fn with_debug(self, debug: bool) -> Self
Set debug mode.
Sourcepub fn with_exclude(self, pattern: impl Into<String>) -> Self
pub fn with_exclude(self, pattern: impl Into<String>) -> Self
Add an exclude pattern.
Sourcepub fn with_excludes(self, patterns: Vec<String>) -> Self
pub fn with_excludes(self, patterns: Vec<String>) -> Self
Set multiple exclude patterns.
Sourcepub fn with_threshold(self, threshold: Severity) -> Self
pub fn with_threshold(self, threshold: Severity) -> Self
Set the severity threshold.
Sourcepub fn with_rule(self, rule: impl Into<String>, config: RuleConfig) -> Self
pub fn with_rule(self, rule: impl Into<String>, config: RuleConfig) -> Self
Configure a specific rule.
Sourcepub fn with_disable_ignore_pragma(self, disable: bool) -> Self
pub fn with_disable_ignore_pragma(self, disable: bool) -> Self
Disable pragma (comment-based) ignores.
Sourcepub fn is_rule_ignored(&self, code: &RuleCode) -> bool
pub fn is_rule_ignored(&self, code: &RuleCode) -> bool
Check if a rule is ignored (disabled).
Sourcepub fn get_rule_config(&self, code: &str) -> Option<&RuleConfig>
pub fn get_rule_config(&self, code: &str) -> Option<&RuleConfig>
Get the configuration for a specific rule.
Sourcepub fn effective_severity(&self, code: &RuleCode, default: Severity) -> Severity
pub fn effective_severity(&self, code: &RuleCode, default: Severity) -> Severity
Get the effective severity for a rule, applying any overrides.
Sourcepub fn should_report(&self, severity: Severity) -> bool
pub fn should_report(&self, severity: Severity) -> bool
Check if an issue should be reported based on threshold.
Sourcepub fn is_excluded(&self, path: &str) -> bool
pub fn is_excluded(&self, path: &str) -> bool
Check if a file path should be excluded.
Trait Implementations§
Source§impl Clone for DclintConfig
impl Clone for DclintConfig
Source§fn clone(&self) -> DclintConfig
fn clone(&self) -> DclintConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DclintConfig
impl Debug for DclintConfig
Auto Trait Implementations§
impl Freeze for DclintConfig
impl RefUnwindSafe for DclintConfig
impl Send for DclintConfig
impl Sync for DclintConfig
impl Unpin for DclintConfig
impl UnwindSafe for DclintConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.