pub struct RulesConfig {
pub global_allow: Vec<String>,
pub sarif_tools: Vec<SarifTool>,
pub rules: HashMap<String, RuleOverride>,
}Expand description
Rules configuration covering all engines (syntax, fact, native, sarif).
Deserialized from [rules] in .normalize/config.toml. Per-rule overrides
live under [rules.rule."<id>"]. Engine-wide settings live as bare keys
directly under [rules] (e.g. global-allow, sarif-tools).
Legacy layout ([rules."<id>"] directly under [rules]) is still parsed
for one release with a stderr deprecation warning. It is unsound in principle
because a rule named global-allow would collide with the engine-wide key —
the new nested layout removes the namespace collision.
Fields§
§global_allow: Vec<String>Allow patterns applied to every rule (e.g. ["**/tests/fixtures/**"]).
Entries here skip violations in matching files across all rules.
sarif_tools: Vec<SarifTool>External tools that emit SARIF 2.1.0 output (the sarif engine).
rules: HashMap<String, RuleOverride>Per-rule configuration overrides, keyed by rule ID.
Serialized under the rule sub-table ([rules.rule."<id>"]). On
deserialization, both the new nested layout and the legacy flat layout
([rules."<id>"]) are accepted; the legacy form emits a stderr
deprecation warning.
Trait Implementations§
Source§impl Clone for RulesConfig
impl Clone for RulesConfig
Source§fn clone(&self) -> RulesConfig
fn clone(&self) -> RulesConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RulesConfig
impl Debug for RulesConfig
Source§impl Default for RulesConfig
impl Default for RulesConfig
Source§fn default() -> RulesConfig
fn default() -> RulesConfig
Source§impl<'de> Deserialize<'de> for RulesConfig
impl<'de> Deserialize<'de> for RulesConfig
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>,
Source§impl JsonSchema for RulesConfig
impl JsonSchema for RulesConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Merge for RulesConfig
impl Merge for RulesConfig
Source§fn merge(self, other: Self) -> Self
fn merge(self, other: Self) -> Self
Merge two RulesConfig values, with other taking priority.
- Vec fields (
global_allow,sarif_tools): ifother’s field is non-empty it replacesself’s field; an emptyotherfield inherits fromself. This means you cannot reset a Vec to empty via merge — an emptyothervec is treated as “no override” rather than “clear the list”. rulesHashMap: merged usingextend, soother’s keys overrideself’s keys. Keys present only inselfare preserved.