Skip to content

CLI Reference

fensu rule

Inspect the full metadata for a single core, native-pack, or custom rule code.

fensu rule prints the complete metadata for one rule: its family, severity, whether it is on by default, its source, and its full message and remediation. Use it to understand a code you saw in fensu check output, or to read what a rule claims before you enable or disable it.

fensu rule CODE [--color MODE] [--target TARGET]
fensu rule FFS131
FFS131 no-complex-comprehensions
Family: shape
Severity: error
Kind: core
Enabled by default: yes
Source: core
Message: nested or multi-generator comprehensions hide control flow and data shapes
Remediation: Extract a named helper when the transformation has a coherent purpose. For one-off
local logic, use simple statements with named intermediate values instead of nested
comprehension control flow.

The lookup is case-insensitive, so fensu rule ffs131 works too. When multiple analyzer targets are configured, select the catalogue and policy context explicitly:

fensu rule FPSKA001 --target web
FieldMeaning
HeaderThe code and slug.
FamilyThe rule’s family.
Severityerror or warning.
Kindcore for the default policy, pack for an activated native pack, or custom for your own rule.
PackThe owning native pack, or None.
AliasThe canonical core implementation used by a transparent pack alias, or None.
Enabled by defaultWhether the rule runs without being named explicitly.
Sourcecore, or the file or module a custom rule was loaded from.
MessageThe one-sentence statement of the violated contract.
RemediationThe normal correction, or None provided. if the rule sets none.
OptionsDeclared types, defaults, current values, descriptions, choices, and bounds.

Severity is catalogue metadata declared by the rule. Configuring a rule in warn assigns it to the project’s advisory tier without changing that metadata. Use fensu check --warn to see the effective tier in a run.

When the queried code matches configured exact exceptions or path-scoped rule_ignores, fensu rule also prints those active policy declarations and their reasons.

fensu rule reads the whole catalogue for the current repository, so it resolves custom rules once they are configured and native rule packs once activated. It can inspect rules that are ignored or off by default. A custom rule shows its source path:

fensu rule XAC001
XAC001 no-acme-global
Family: custom
Severity: error
Kind: custom
Enabled by default: yes
Source: scripts/fensu_policy/rules/boundaries.py
Message: ACME_GLOBAL hides ownership
Remediation: Move the value to the module that owns and produces it.
Options:
allowed_names
Type: list[string]
Required: false
Default: []
Current value: ["alpha", "beta"]
Description: Names permitted by this policy.
Choices: null
Minimum: None
Maximum: None
Minimum items: None

For an option without a default, Default is required. Defaults come from rule source; current values use a TOML override when present. fensu rule never writes either value back to configuration.

An activated pack rule shows its pack and any canonical alias target:

FPDGA001 parameter-annotation
Family: annotations
Severity: error
Kind: pack
Pack: dagster
Alias: FFA001
Enabled by default: yes
Source: core
OptionValuesDefaultPurpose
--colorauto, always, neverautoANSI color behavior. Respects NO_COLOR.
--targetconfigured target nameautomatic for one targetSelect the analyzer catalogue and target-local policy.
CodeMeaning
0The rule was found and printed.
2The code is not a known rule.

An unknown code reports:

Unknown rule code: NOPE