pub fn filter_rules(
rules: &[Box<dyn Rule>],
global_config: &GlobalConfig,
) -> Vec<Box<dyn Rule>>Expand description
Filter rules according to global_config.{enable,disable,extend_enable,extend_disable}.
Rule-name entries may be either canonical IDs ("MD033") or aliases
("no-inline-html"); both forms match identically. Canonical IDs are
the norm — every Config produced through a mutation boundary
(From<SourcedConfig> for Config, LSP apply_lsp_settings_*, WASM
to_config_with_warnings) is canonicalised by
Config::canonicalize_rule_lists. The defensive canonicalisation here
keeps filter_rules correct for programmatic callers that build a
GlobalConfig without going through those boundaries.