Skip to content

test(cli): finish command format-profile matrix #949

Closed

Description

@Sinity

Problem

#445 introduced the shared root format profile, but the #944 audit found remaining command-level drift:

  • tags and neighbors remain JSON-only;
  • query/raw/show still have command-specific format subsets;
  • the command x format contract is not fully matrix-tested.

Split from #944 because this is a bounded CLI contract/test matrix and can land independently of architecture cleanup.

Scope

  • Inventory every command that accepts or inherits --format.
  • Decide which formats are supported, rejected, or intentionally command-local for each command.
  • Add matrix tests so accepted/rejected combinations are explicit.
  • Refresh generated CLI reference after the behavior is truthful.

Acceptance Criteria

  • A command x format matrix exists in tests or generated docs and covers tags, neighbors, query verbs, raw, and show.
  • Unsupported formats fail with clear Click/user errors, not accidental tracebacks or ignored options.
  • JSON-only commands are either expanded or documented as intentional exceptions.
  • devtools render-all --check passes after generated reference updates.

Verification

pytest -q tests/unit/cli
devtools render-all --check
devtools verify --quick

Ref #944
Ref #445

Activity

  1. Sinity commented on May 8, 2026

    @Sinity
    OwnerAuthor

    Closing: CLI format-profile matrix coverage expanded.

    Changes:

    • Added neighbors to the JSON envelope parametrized test matrix (alongside doctor and tags)
    • Added explicit invalid-format rejection tests: tags --format yaml and neighbors --format markdown verified to produce clear Click Invalid value errors
    • Click's Choice type already enforces format validation at parse time — unsupported formats produce clear error messages, not tracebacks
    • JSON-only commands (tags, neighbors) are documented as intentional: these commands produce structured machine-readable output that maps to a single format

    Existing coverage: test_query_fmt.py provides the query verb format matrix (list, stats, bulk-export across all supported formats), and test_deterministic_output.py covers JSON envelope contracts for machine-readable commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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