Skip to main content

IssueAction

Enum IssueAction 

Source
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): true only when the finding’s hardcoded_consumers array is empty and the source is pnpm-workspace.yaml. When a workspace package still pins a hardcoded version of the same package, fallow fix skips the entry to avoid breaking pnpm install. Bun package.json catalog entries are also emitted with auto_fixable: false because the current fixer is YAML-only.
  • remove-dependency vs move-dependency (dependency findings): when the finding’s used_in_workspaces array is non-empty, the primary action flips to move-dependency with auto_fixable: false (fallow fix will not remove a dependency that another workspace imports). On findings without cross-workspace consumers the action stays remove-dependency with auto_fixable: true.
  • add-to-config for ignoreExports (duplicate-exports): true when fallow fix can 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.json from fallow init’s framework-aware scaffolding and layers the new rules on top). false inside 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): always false today (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

Source

pub const fn is_auto_fixable(&self) -> bool

Whether the current finding-specific action can be applied by fallow fix.

Trait Implementations§

Source§

impl Clone for IssueAction

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IssueAction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for IssueAction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for IssueAction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.