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 FFS131FFS131 no-complex-comprehensionsFamily: shapeSeverity: errorKind: coreEnabled by default: yesSource: coreMessage: nested or multi-generator comprehensions hide control flow and data shapesRemediation: 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 webFields
Section titled “Fields”| Field | Meaning |
|---|---|
| Header | The code and slug. |
| Family | The rule’s family. |
| Severity | error or warning. |
| Kind | core for the default policy, pack for an activated native pack, or custom for your own rule. |
| Pack | The owning native pack, or None. |
| Alias | The canonical core implementation used by a transparent pack alias, or None. |
| Enabled by default | Whether the rule runs without being named explicitly. |
| Source | core, or the file or module a custom rule was loaded from. |
| Message | The one-sentence statement of the violated contract. |
| Remediation | The normal correction, or None provided. if the rule sets none. |
| Options | Declared 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.
Custom and configured rules
Section titled “Custom and configured rules”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 XAC001XAC001 no-acme-globalFamily: customSeverity: errorKind: customEnabled by default: yesSource: scripts/fensu_policy/rules/boundaries.pyMessage: ACME_GLOBAL hides ownershipRemediation: 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: NoneFor 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-annotationFamily: annotationsSeverity: errorKind: packPack: dagsterAlias: FFA001Enabled by default: yesSource: coreOptions
Section titled “Options”| Option | Values | Default | Purpose |
|---|---|---|---|
--color | auto, always, never | auto | ANSI color behavior. Respects NO_COLOR. |
--target | configured target name | automatic for one target | Select the analyzer catalogue and target-local policy. |
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | The rule was found and printed. |
2 | The code is not a known rule. |
An unknown code reports:
Unknown rule code: NOPE