Skip to content

Validate --target values (avoid silent fallback) #129

@avifenesh

Description

@avifenesh

Issue from /audit-project

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

Description

The CLI --target flag is a free-form string and unknown values silently fall back to Generic, so typos go unnoticed.

Current Behavior

#[arg(short, long, default_value = "generic")]
target: String,
...
match cli.target.as_str() { ... _ => TargetTool::Generic }

Proposed Fix

Use a ValueEnum for target and reject unknown values (optionally accepting config-style spellings like ClaudeCode).

Impact

Mis-typed targets can silently change which rules run, leading to unexpected results.

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