| 6 | /// Global defaults inherited by every rule unless the rule overrides them. |
| 7 | #[derive(Debug, Deserialize, Default, Clone)] |
| 8 | pub struct Defaults { |
| 9 | /// File-path glob patterns excluded from ALL rules (e.g. "*tests*", "*/fixtures/*"). |
| 10 | /// Rules may add their own exclude_file_pattern on top of these. |
| 11 | #[serde(default)] |
| 12 | pub exclude_file_patterns: Vec<String>, |
| 13 | /// Rule IDs that are completely disabled (produce too much noise for this codebase). |
| 14 | /// Disabling here is equivalent to deleting the rule but without touching the rule |
| 15 | /// definitions — making it easy to re-enable or override per project. |
| 16 | #[serde(default)] |
| 17 | pub disabled_rule_ids: Vec<String>, |
| 18 | /// Precompiled form of `exclude_file_patterns`, built once by `RuleSet::finalize()`. |
| 19 | /// `WildMatch::new()` parses/allocates on every call, and these patterns are checked |
| 20 | /// for every (file, rule) pair during a scan — compiling once avoids redoing that |
| 21 | /// parse work millions of times over on a large codebase. |
| 22 | #[serde(skip)] |
| 23 | pub compiled_exclude_file_patterns: Vec<WildMatch>, |
| 24 | } |
| 25 | |
| 26 | #[derive(Debug, Deserialize, Clone)] |
| 27 | pub struct Rule { |
nothing calls this directly
no outgoing calls
no test coverage detected