pub struct FilterConfig {
pub include: RuleFilterConfig,
pub exclude: RuleFilterConfig,
/* private fields */
}Expand description
Include/exclude filter configuration for diagnostics.
If include filters are non-empty, a diagnostic must match at least one. Any diagnostic matching an exclude filter is removed regardless.
Fields§
§include: RuleFilterConfig§exclude: RuleFilterConfigImplementations§
Source§impl FilterConfig
impl FilterConfig
pub fn new(include: RuleFilterConfig, exclude: RuleFilterConfig) -> Self
pub fn is_empty(&self) -> bool
pub fn matches_rule( &self, rule_id: &str, category: Option<&str>, resource_id: Option<&str>, resource_type: Option<&str>, logical_id: Option<&str>, entity_type: Option<EntityType>, ) -> bool
pub fn excluded_categories(&self) -> HashSet<&str>
Sourcepub fn invalid_patterns(&self) -> Vec<String>
pub fn invalid_patterns(&self) -> Vec<String>
Every id_patterns entry (from either the include or exclude filter) that is not a valid
regular expression. Callers should surface these rather than let them be silently discarded:
a dropped include pattern in particular would otherwise filter out every diagnostic, because
the include set is treated as non-empty yet matches nothing.
Sourcepub fn globally_suppresses_builtin_rule(
&self,
rule_id: &str,
category: Option<&str>,
severity: Severity,
strict: bool,
severity_level: Severity,
) -> bool
pub fn globally_suppresses_builtin_rule( &self, rule_id: &str, category: Option<&str>, severity: Severity, strict: bool, severity_level: Severity, ) -> bool
Whether global filtering can prove, before any rule evaluation, that no diagnostic this built-in rule could emit will survive finalization - regardless of the resource, path, or entity it fires on. A rule proven globally unable to survive can skip its work entirely without changing the reported diagnostics, because finalization would have removed every one of its findings anyway.
Only dimensions that apply uniformly to every diagnostic of the rule are consulted: the minimum-severity gate (accounting for the strict promotion of Warn to Error) and the global include/exclude dimensions - exact ID, category, ID range, and ID regex. The scoped resource-id, logical-id, resource-type, and service dimensions can still admit the rule for some resource, so they never justify global suppression.