Skip to content

Add --output-format flag with JSON support #19

@jakekaplan

Description

@jakekaplan

Summary

Add --output-format text|json flag to the check command for machine-readable output.

Motivation

JSON output enables:

  • Editor/IDE integrations
  • CI tooling pipelines
  • LLM-assisted workflows
  • Programmatic consumption of results

This is standard for modern linters (Ruff, ESLint, etc.).

Design

Flag: --output-format <FORMAT>

  • text (default) - current human-readable colored output
  • json - machine-readable JSON

Applies to: check command only

JSON structure (document in README, no formal schema):

{
  "version": "0.1.0",
  "violations": [
    {
      "path": "src/main.rs",
      "lines": 1427,
      "max_lines": 500,
      "rule": "default"
    }
  ],
  "summary": {
    "files_checked": 42,
    "violations": 1,
    "duration_ms": 123
  }
}

Tasks

  • Add OutputFormat enum to CLI args
  • Implement JSON serialization for findings
  • Update output module to support format switching
  • Add integration tests for JSON output
  • Document JSON structure in README

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions