Skip to content

[CLI] Rename OutputFormatWithAuto to OutputFormat#4286

Merged
hanouticelina merged 1 commit into
cli-cleanup-legacy-cli-utils-helpersfrom
cli-rename-output-format
May 28, 2026
Merged

[CLI] Rename OutputFormatWithAuto to OutputFormat#4286
hanouticelina merged 1 commit into
cli-cleanup-legacy-cli-utils-helpersfrom
cli-rename-output-format

Conversation

@hanouticelina

@hanouticelina hanouticelina commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Stacked on top of #4285.

Now that the legacy OutputFormat (the old table | json enum) has been deleted, the name is free. OutputFormatWithAuto was always the "real" enum — covering auto | human | agent | json | quiet — so this drops the disambiguating suffix.

  • Pure rename across _output.py, _cli_utils.py, _file_listing.py, buckets.py, and the two test files.
  • Also removes a stale TODO comment in _output.py that referenced the (now deleted) legacy enum.

No behavior change.

$ pytest tests/test_cli_output.py tests/test_cli.py
======================= 278 passed, 7 warnings in 12.91s =======================

Note

Low Risk
Mechanical rename and comment cleanup only; tests confirm unchanged CLI output behavior.

Overview
Renames the CLI output-mode enum from OutputFormatWithAuto to OutputFormat everywhere it is imported or referenced (_output.py, _cli_utils.py, _file_listing.py, buckets.py, and CLI tests). The enum still covers auto, human, agent, json, and quiet; only the type name changes now that the older, narrower OutputFormat was removed elsewhere.

Also drops a stale TODO in _output.py that pointed at that legacy enum. No runtime or CLI behavior change—format flag handling and out.set_mode() logic are unchanged.

Reviewed by Cursor Bugbot for commit 50e1fa9. Configure here.

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.
@bot-ci-comment

Copy link
Copy Markdown

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.

@Wauplin Wauplin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@hanouticelina hanouticelina merged commit c40a6d5 into cli-cleanup-legacy-cli-utils-helpers May 28, 2026
19 checks passed
@hanouticelina hanouticelina deleted the cli-rename-output-format branch May 28, 2026 08:27
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.
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.

2 participants