pub struct Config {
pub enabled_categories: Vec<String>,
pub disabled_categories: Vec<String>,
pub enabled_rules: Vec<String>,
pub disabled_rules: Vec<String>,
pub deprecated_warning: DeprecatedWarningLevel,
pub markdownlint_compatible: bool,
pub auto_fix: bool,
pub rule_configs: HashMap<String, Value>,
}Expand description
Core configuration for the linting engine
Fields§
§enabled_categories: Vec<String>List of enabled rule categories
disabled_categories: Vec<String>List of disabled rule categories
enabled_rules: Vec<String>List of explicitly enabled rules
disabled_rules: Vec<String>List of explicitly disabled rules
deprecated_warning: DeprecatedWarningLevelHow to handle deprecated rule warnings
markdownlint_compatible: boolEnable markdownlint compatibility mode (disables rules that are disabled by default in markdownlint)
auto_fix: boolGlobal auto-fix setting (default: true when –fix is used) Can be overridden per-rule in rule-specific configuration
rule_configs: HashMap<String, Value>Rule-specific configuration
Implementations§
Source§impl Config
impl Config
Sourcepub fn should_run_rule(
&self,
rule_id: &str,
rule_category: &str,
rule_enabled_by_default: bool,
) -> bool
pub fn should_run_rule( &self, rule_id: &str, rule_category: &str, rule_enabled_by_default: bool, ) -> bool
Check if a rule should be run based on configuration
Sourcepub fn should_auto_fix_rule(&self, rule_id: &str) -> bool
pub fn should_auto_fix_rule(&self, rule_id: &str) -> bool
Check if auto-fix is enabled for a specific rule
Returns true if:
- The rule has
auto-fix = truein its config, OR - The rule has no
auto-fixsetting and globalauto-fixis true (default)
Returns false if:
- The rule has
auto-fix = falsein its config, OR - The rule has no
auto-fixsetting and globalauto-fixis false
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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