Skip to content

Commit 194db20

Browse files
authored
refactor(display): split output/display.py by output surface (#41) (#82)
* refactor(display): split output/display.py by output surface Move the 880-line output/display.py into focused per-surface modules: - output/_console.py — canonical Console() instance - output/formatting.py — byte / param / date / color helpers - output/ranking.py — display_ranking + display_hardware - output/plan.py — display_plan - output/upgrade.py — display_upgrade + summarize/verdict helpers - output/json_output.py — display_json + display_plan_json + display_upgrade_json - output/display.py — thin re-export shim (38 lines, was 880) Tests that captured output by patching display.console now patch whichllm.output._console.console instead, which is the new single source of truth that every surface module looks up at call time. Behavior-preserving: no ranking, plan, upgrade, or JSON output changes. All 220 tests pass. Refs #41 * style(display): wrap long print line to satisfy ruff format
1 parent 9864db4 commit 194db20

10 files changed

Lines changed: 973 additions & 884 deletions

File tree

src/whichllm/output/_console.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Canonical Rich Console instance shared by every output surface.
2+
3+
Tests patch the ``console`` attribute on this module to capture output
4+
(e.g. ``whichllm.output._console.console = Console(file=buf, ...)``).
5+
Surface modules look up the console via this module so the patch
6+
propagates without each module holding its own binding.
7+
"""
8+
9+
from rich.console import Console
10+
11+
console = Console()

0 commit comments

Comments
 (0)