Skip to content

CLI-007: Output Format Options #66

@ajitpratap0

Description

@ajitpratap0

Summary

Add multiple output format options for better CI/IDE integration.

Problem

Limited output formats - only human-readable text, no machine-readable or CI-friendly formats.

Action Items

  1. Add --format flag with options:

    • text - human-readable (default)
    • json - machine-readable, structured
    • yaml - human-friendly structured
    • junit - CI integration (JUnit XML)
    • checkstyle - IDE integration (Checkstyle XML)
  2. Apply to all commands (validate, format, analyze, lint)

  3. Document JSON/YAML schemas:

    {
      "status": "error",
      "errors": [{
        "file": "query.sql",
        "line": 3,
        "column": 15,
        "message": "unexpected token",
        "code": "E001"
      }]
    }
  4. Add examples for CI/IDE integration

Acceptance Criteria

  • 5 output formats implemented
  • JSON schema documented
  • YAML schema documented
  • CI integration examples (GitHub Actions, GitLab CI)
  • IDE integration examples (VSCode problem matcher)
  • Tests for all formats

Technical Details

Priority: Medium
Effort: Small (12h)
Phase: Phase 3 - UX & Documentation
Dependencies: None

Example Usage

# JSON for scripts
gosqlx validate --format json query.sql | jq '.errors'

# JUnit for CI
gosqlx validate --format junit *.sql > test-results.xml

# Checkstyle for IDE
gosqlx validate --format checkstyle src/

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions