Skip to content

Output formatters (pretty, compact, json, sarif) #5

Description

@ajianaz

Output Formatters

Implement multiple output format backends for review results.

Formats

  1. pretty (default) — Rich terminal output with colors, file names, line numbers, severity icons, and code context
  2. compact — One line per finding, minimal output (good for pre-commit hooks)
  3. json — Machine-readable JSON output for piping to other tools
  4. sarif — SARIF format for GitHub Code Scanning integration

Requirements

  • Trait-based architecture: trait OutputFormatter { fn write(&self, findings: &[Finding], writer: &mut dyn Write) }
  • Severity levels: info, warning, error with icons/colors
  • File path and line number for each finding
  • Configurable via --output flag or config file

Acceptance Criteria

  • All four formats produce correct output
  • Pretty format uses colors and is readable
  • JSON output is valid and complete
  • SARIF output integrates with GitHub Code Scanning

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions