Skip to content

fix: make yaml formatting side-effect free#20

Open
2830500285 wants to merge 1 commit into
openai:mainfrom
2830500285:fix/yaml-format-output
Open

fix: make yaml formatting side-effect free#20
2830500285 wants to merge 1 commit into
openai:mainfrom
2830500285:fix/yaml-format-output

Conversation

@2830500285

Copy link
Copy Markdown

Summary

  • make YAML formatting return bytes like the other output formats instead of writing directly to stdout
  • keep ShowJSON / iterator callers responsible for writing output, so YAML can be buffered, counted, and paged consistently
  • add regression coverage for the formatter side effect and the ShowJSON YAML output path

No linked issue; I found this while looking for another runtime correctness fix after the currently open issues were already covered by existing PRs.

Validation

  • go test ./pkg/cmd -run 'TestFormatJSON|TestShowJSONYAML|TestShowJSONIterator'
  • go test ./... -run 'TestFormatJSON|TestShowJSONYAML|TestShowJSONIterator'
  • go build ./...

Note: I also attempted go test ./... locally, but this Windows environment is missing /bin/bash for the autocomplete tests and does not have the mock server running on localhost:4010 for generated command tests.

@2830500285 2830500285 requested a review from a team as a code owner May 22, 2026 08:23
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