pub enum IssueAction {
Fix(FixAction),
SuppressLine(SuppressLineAction),
SuppressFile(SuppressFileAction),
AddToConfig(AddToConfigAction),
}Expand description
A suggested action attached to a finding in the JSON output. Each finding
carries an actions array; consumers (agents, IDE clients, CI bots) can
dispatch on the type discriminant to choose the right remediation.
The discriminator is type (snake_case type field), the payload uses the
matching kebab-case identifier per variant.
§auto_fixable is per-finding, not per action type
Every action variant carries an auto_fixable: bool field. The value is
evaluated PER FINDING, not per action type: the same action type may
appear with auto_fixable: true on one finding and auto_fixable: false
on another, depending on per-instance guards in the fallow fix applier.
Agents that filter on auto_fixable: true must branch on the bool of
each individual finding’s action, not on the action type alone.
Current per-instance flips:
remove-catalog-entry(unused-catalog-entries):trueonly when the finding’shardcoded_consumersarray is empty and the source ispnpm-workspace.yaml. When a workspace package still pins a hardcoded version of the same package,fallow fixskips the entry to avoid breakingpnpm install. Bunpackage.jsoncatalog entries are also emitted withauto_fixable: falsebecause the current fixer is YAML-only.remove-dependencyvsmove-dependency(dependency findings): when the finding’sused_in_workspacesarray is non-empty, the primary action flips tomove-dependencywithauto_fixable: false(fallow fixwill not remove a dependency that another workspace imports). On findings without cross-workspace consumers the action staysremove-dependencywithauto_fixable: true.add-to-configforignoreExports(duplicate-exports):truewhenfallow fixcan safely apply the action without further user setup. That is: a fallow config file exists on disk, OR no config exists AND the working directory is NOT inside a monorepo subpackage (in which case the applier creates.fallowrc.jsonfromfallow init’s framework-aware scaffolding and layers the new rules on top).falseinside a monorepo subpackage with no workspace-root config (the applier refuses to fragment per-package configs across the monorepo and points at the workspace root instead).update-catalog-reference(unresolved-catalog-references): alwaysfalsetoday (the catalog-switching applier is not wired in yet); the field is non-singleton so that future enablement does not require a schema change.
All suppress-line and suppress-file actions are uniformly
auto_fixable: false. The field is non-singleton on the wire so that a
future auto-applier (e.g. an LLM-driven suppression writer) can promote
individual variants without a schema bump.
Variants§
Fix(FixAction)
A code-change fix the user can apply (auto-fixable by fallow fix for
some variants, manual for others).
SuppressLine(SuppressLineAction)
Place a // fallow-ignore-next-line ... comment above the offending
line. Always manual.
SuppressFile(SuppressFileAction)
Place a // fallow-ignore-file ... comment at the top of the file.
Always manual.
AddToConfig(AddToConfigAction)
Add the offending finding to the fallow config (e.g.
ignoreDependencies: ["lodash"]). Auto-fixable for the array-shaped
ignoreExports variant when fallow fix can safely apply the
action (config file exists, or no config exists and the working
directory is not inside a monorepo subpackage); manual otherwise.
Implementations§
Source§impl IssueAction
impl IssueAction
Sourcepub const fn is_auto_fixable(&self) -> bool
pub const fn is_auto_fixable(&self) -> bool
Whether the current finding-specific action can be applied by
fallow fix.