Skip to content

fix(init): keep template list stdout clean for structured output - #177

Open
pcbeingused33 wants to merge 1 commit into
deepgram:mainfrom
pcbeingused33:fix/init-list-json
Open

pcbeingused33 wants to merge 1 commit into
deepgram:mainfrom
pcbeingused33:fix/init-list-json

Conversation

@pcbeingused33

Copy link
Copy Markdown

Summary

dg -o json init --list writes the human-readable template table and count (or the empty-results message) before the JSON payload. A JSON parser reading stdout fails at the first character.

Changes

  • Render the template table, count, and empty-results message only in the default output mode.
  • Send fetch progress to stderr when an output format is selected and let the existing formatter write the result.

Test plan

  • make check passes (format, lint, typecheck)
  • make dev passes (format, lint, tests)
  • Manual testing of the affected command with a mocked template API

The init suite covers populated JSON output, an empty JSON array, and the default table. Both JSON cases fail on the base revision and pass with this change. The init suite reports 213 passed and 2 skipped. make dev was not run; the init package tests were run directly with pytest. A CLI invocation of dg -o json init --list with an empty mocked API response returned []. make readmes confirmed that the package READMEs are current.

Related issues

Related to #98.

AI assistance was used to prepare this change.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant