Skip to main content

Module rule

Module rule 

Source

Structs§

AiCheck
Optional AI confirmation step for a rule. When present, the rule’s rule AST pattern acts as a cheap pre-filter: matches become candidates that an LLM must confirm before they are reported. The AST layer never executes this field; the AI pipeline in slopguard-ai reads it.
LanguageIter
An iterator over the variants of Language
Rule
RuleId
RuleTests

Enums§

Category
Language
RuleError
Severity

Functions§

is_rule_active
Whether a builtin rule takes part in a scan under config.
load_all_rules
Load all rules (builtin + custom) without filtering by activation status. Used by explain to look up any rule regardless of config.
load_builtin_rules
Load all builtin rules embedded via rust-embed.
load_custom_rules
Load rules from custom directories on the filesystem. Missing directories are skipped; subdirectories are searched recursively.
load_effective_rules
Load all effective rules based on config: builtin (filtered by rulesets and the enable/disable lists) plus custom rules from configured directories.
parse_rule
Parse a single YAML string into a Rule, validating required fields.
validate_unique_ids
Validate that all rule (id, language) pairs are unique. The same rule id may appear for different languages (e.g. no-todo-fixme for both Rust and TypeScript), so a single rules.disable entry covers both variants.