Skip to content

Fix flags ignored with JSON/SARIF output #128

@avifenesh

Description

@avifenesh

Issue from /audit-project

Severity: Low
Category: Code Quality
Effort: Small (~1-2 hours)

Description

--fix, --dry-run, and --fix-safe are ignored when --format json or --format sarif is used because the function returns early before fix logic.

Current Behavior

if matches!(cli.format, OutputFormat::Json) { ... return Ok(()); }
if matches!(cli.format, OutputFormat::Sarif) { ... return Ok(()); }

Proposed Fix

Either error out when fix flags are combined with non-text output, or apply fixes before serialization and report them in the output.

Impact

Users may assume fixes were applied when they were silently skipped.

Files

  • crates/agnix-cli/src/main.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions