pub struct Config {
pub style: Style,
pub rules: RulesConfig,
pub ignore: Vec<String>,
pub min_glib_version: Option<(u32, u32)>,
pub msvc_compatible: bool,
pub format: Option<OutputFormat>,
pub editor_url: Option<String>,
pub build_dir: Option<String>,
pub default_level: Option<RuleLevel>,
}Fields§
§style: Style§rules: RulesConfig§ignore: Vec<String>§min_glib_version: Option<(u32, u32)>Minimum supported GLib version as (major, minor) Rules requiring newer GLib versions will be automatically disabled
msvc_compatible: boolTarget MSVC-compatible code
format: Option<OutputFormat>Output format
editor_url: Option<String>Editor URL format for clickable links Available placeholders: {path}, {line}, {column} Examples: VSCode: “vscode://file{path}:{line}:{column}” IntelliJ: “idea://open?file={path}&line={line}” Sublime: “subl://open?url=file://{path}&line={line}&column={column}”
build_dir: Option<String>Build directory for meson introspection (used for dead code analysis) If not specified, will search for common build directories (build/, builddir/, _build/)
default_level: Option<RuleLevel>Default severity level for all non-opt-in rules.
Opt-in rules always default to “ignore” regardless of this setting.
Per-rule level settings override this.
Implementations§
Source§impl Config
impl Config
pub fn load(path: &Path) -> Result<Self>
pub fn build_ignore_matcher(&self) -> Result<GlobSet>
Sourcepub fn build_rule_ignore_matcher(
&self,
rule_config: &RuleConfig,
) -> Result<GlobSet>
pub fn build_rule_ignore_matcher( &self, rule_config: &RuleConfig, ) -> Result<GlobSet>
Build an ignore matcher for a specific rule, combining global and per-rule ignores
Sourcepub fn get_rule_config(&self, field_name: &str) -> Option<&RuleConfig>
pub fn get_rule_config(&self, field_name: &str) -> Option<&RuleConfig>
Get reference to a rule config by field name
Sourcepub fn get_rule_config_mut(
&mut self,
field_name: &str,
) -> Option<&mut RuleConfig>
pub fn get_rule_config_mut( &mut self, field_name: &str, ) -> Option<&mut RuleConfig>
Get mutable reference to a rule config by field name
pub fn get_string_list(&self, rule_name: &str, key: &str) -> Vec<String>
Sourcepub fn enable_only_rules(&mut self, rule_names: &[String]) -> Result<()>
pub fn enable_only_rules(&mut self, rule_names: &[String]) -> Result<()>
Enable only specific rules, disabling all others
Sourcepub fn disable_rules(&mut self, rule_names: &[String]) -> Result<()>
pub fn disable_rules(&mut self, rule_names: &[String]) -> Result<()>
Disable specific rules (all others remain enabled according to config)
Sourcepub fn filter_by_category(&mut self, category: Category) -> Result<()>
pub fn filter_by_category(&mut self, category: Category) -> Result<()>
Filter rules by category, disabling all others
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>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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