Skip to content

MAINT Deduplicate pretty output color formatting - #2318

Merged
romanlutz merged 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-deduplicate-output-colors
Aug 4, 2026
Merged

MAINT Deduplicate pretty output color formatting#2318
romanlutz merged 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-deduplicate-output-colors

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

Five pretty output printers carried identical ANSI line-formatting implementations, increasing maintenance cost and making behavior easier to drift. This change extracts that behavior into a narrow internal _PrettyPrinterMixin while keeping each domain printer's public API, inheritance contract, and rendered output unchanged.

All five pretty printers inherit the shared helper, leaving generic and domain-specific printer bases untouched. Focused coverage verifies exact colored output, disabled-color output, and the no-color argument path.

Tests and Documentation

  • uv run pytest tests\unit\output -q (188 passed)
  • uv run ruff check on changed files
  • uv run ruff format --check on changed files
  • uv run ty check on changed files
  • git diff --check
  • Pre-commit hooks passed during commit

Documentation was not updated because this is an internal refactor with no public API or behavior change. JupyText was not applicable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 026dff00-745e-42fb-9748-5555ee006073

@varunj-msft varunj-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

@varunj-msft varunj-msft self-assigned this Aug 4, 2026
@romanlutz
romanlutz added this pull request to the merge queue Aug 4, 2026
Merged via the queue into microsoft:main with commit faeed9f Aug 4, 2026
54 checks passed
@romanlutz
romanlutz deleted the romanlutz-deduplicate-output-colors branch August 4, 2026 19:21
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.

3 participants