Skip to content

Add machine-readable --json output to reporting commands #9

Description

@AshwinUgale

Context

coverage, drift, mine, and select print human-formatted text only. The CLI already advertises a stable exit-code contract for automation, and most of these commands already build a to_dict() report internally — so the data is right there, just not emitted in a machine-readable form.

Task

Add a --json flag to the reporting commands (coverage, drift, mine, select) that prints the underlying report dict as JSON to stdout, suppressing the human-formatted text under the flag.

Acceptance criteria

  • JSON goes to stdout; diagnostics/warnings stay on stderr.
  • Exit codes unchanged (the existing contract still holds).
  • One test per command asserting the output parses as JSON with the expected keys.

Pointers

  • _cmd_coverage, _cmd_drift, _cmd_mine, _cmd_select in src/goldset/cli.py

Help wanted

Scoped and mechanical, but touches four commands — a good second contribution. Can be split into one command per PR if a newcomer prefers a smaller first bite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions