Skip to main content

Module explain

Module explain 

Source
Expand description

CLI rendering for explainable rule output.

The rule registry and JSON contract live in fallow-api so embedders and MCP do not depend on the CLI crate. This module keeps terminal rendering and compatibility re-exports for existing CLI call sites.

Structs§

RuleDef
Rule definition for SARIF fullDescription and JSON _meta.
RuleGuide
Extra educational content for the standalone fallow explain <issue-type> command. Kept separate from RuleDef so SARIF and _meta payloads remain compact while terminal users and agents can ask for worked examples on demand.

Constants§

CHECK_RULES
Rule definitions for every dead-code family finding.
DUPES_RULES
Rule definitions for duplication findings.
FLAGS_RULES
Rule definitions for feature-flag findings.
HEALTH_RULES
Rule definitions for complexity and health findings.
SECURITY_RULES
Rule definitions for security candidate findings, including the data-driven tainted-sink catalogue categories.

Functions§

coverage_analyze_meta
Build the _meta object for fallow coverage analyze --format json --explain.
coverage_setup_meta
Build the _meta object for fallow coverage setup --json --explain.
rule_by_id
Look up a rule definition by its SARIF rule ID across all rule sets.
rule_by_token
Look up an issue type from a user-facing token.
rule_docs_url
Build the docs URL for a rule.
rule_guide
Return worked-example and fix guidance for a rule.
rule_severity_key
The rules.* config key whose default severity gates findings of rule: the rule’s own config_key for a 1:1 rule, else the key of the shared rule its suppression token names (every tainted-sink catalogue category is gated by security-sink, coverage findings by coverage-gaps). None for findings with no rules.* gate at all (complexity and duplication metrics, refactoring targets, runtime-coverage verdicts); a suppression token that is not a rules.* key (code-duplication, feature-flag) yields None too, so every returned key resolves in crate::schemas::default_rule_severities.
security_meta
Build the _meta object for fallow security --format json --explain.
serialize_explain_programmatic_json
Serialize standalone explain output using the programmatic API contract.