[CLI] Rename OutputFormatWithAuto to OutputFormat#4286
Merged
hanouticelina merged 1 commit intoMay 28, 2026
Conversation
The legacy `OutputFormat` (table | json) was removed in the previous cleanup PR, freeing up the name. `OutputFormatWithAuto` was always the "real" enum — covering auto/human/agent/json/quiet — so drop the disambiguating suffix. Pure rename, no behavior change. Also removes the now-stale TODO comment in `_output.py` that referenced the (now deleted) legacy enum.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
c40a6d5
into
cli-cleanup-legacy-cli-utils-helpers
19 checks passed
hanouticelina
added a commit
that referenced
this pull request
May 28, 2026
* [CLI] Drop legacy printing helpers from `_cli_utils.py` Now that every command has migrated to the `out` singleton, the legacy helpers in `_cli_utils.py` have no callers. The one exception was `api_object_to_dict`, which still served dataclass→dict conversion before `out.table` / JSON serialization — and `_output.py` already exposes the same helper as `_dataclass_to_dict`. So: - Switch every caller (discussions, models, datasets, papers, spaces, collections, _file_listing) from `api_object_to_dict` to `_dataclass_to_dict` from `_output.py`. - Delete from `_cli_utils.py`: `api_object_to_dict`, `_serialize_value`, `print_as_table`, `print_list_output`, `_format_cell`, `_format_value`, `_to_header`, `_MAX_CELL_LENGTH`, plus the legacy option types and enum (`OutputFormat`, `_set_output_mode`, `FormatOpt`, `FormatWithAutoOpt`, `QuietOpt`). Remove now-orphaned imports (`json`, `dataclasses`, `datetime`, `tabulate`, `Union`). - Update `tests/test_cli_output.py` to import `OutputFormatWithAuto` from `_output.py` directly instead of via the `_cli_utils.py` re-export. No behavior change. * [CLI] Rename `OutputFormatWithAuto` to `OutputFormat` (#4286) The legacy `OutputFormat` (table | json) was removed in the previous cleanup PR, freeing up the name. `OutputFormatWithAuto` was always the "real" enum — covering auto/human/agent/json/quiet — so drop the disambiguating suffix. Pure rename, no behavior change. Also removes the now-stale TODO comment in `_output.py` that referenced the (now deleted) legacy enum.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on top of #4285.
Now that the legacy
OutputFormat(the oldtable | jsonenum) has been deleted, the name is free.OutputFormatWithAutowas always the "real" enum — coveringauto | human | agent | json | quiet— so this drops the disambiguating suffix._output.py,_cli_utils.py,_file_listing.py,buckets.py, and the two test files.TODOcomment in_output.pythat referenced the (now deleted) legacy enum.No behavior change.
Note
Low Risk
Mechanical rename and comment cleanup only; tests confirm unchanged CLI output behavior.
Overview
Renames the CLI output-mode enum from
OutputFormatWithAutotoOutputFormateverywhere it is imported or referenced (_output.py,_cli_utils.py,_file_listing.py,buckets.py, and CLI tests). The enum still coversauto,human,agent,json, andquiet; only the type name changes now that the older, narrowerOutputFormatwas removed elsewhere.Also drops a stale TODO in
_output.pythat pointed at that legacy enum. No runtime or CLI behavior change—format flag handling andout.set_mode()logic are unchanged.Reviewed by Cursor Bugbot for commit 50e1fa9. Configure here.