Skip to content

Refactor: Extract a StatusLineFormatter - #16186

Open
srittau wants to merge 3 commits into
python:mainfrom
srittau:formatter
Open

Refactor: Extract a StatusLineFormatter#16186
srittau wants to merge 3 commits into
python:mainfrom
srittau:formatter

Conversation

@srittau

@srittau srittau commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

This formatter is a context manager that ensures that in scripts that process multiple items, each item has a proper "item name... status" line that is not interrupted by additional output. Any additional output is printed in usually muted colors below the initial status line.

Currently, this is only implemented for stubtest_third_party, where this was already implemented correctly manually, but this will prove very useful for stubsabot, which currently has a few bugs related to command output that will be hard to fix manually.

This is not a strict refactoring, as it changes a few strings and colors for better consistency.

image image

This formatter is a context manager that ensures that in scripts that
process multiple items, each item has a proper "item name... status"
line that is not interrupted by additional output. Any additional output
is printed in usually muted colors below the initial status line.

Currently, this is only implemented for stubtest_third_party, where this
was already implemented correctly manually, but this will prove very
useful for stubsabot, which currently has a few bugs related to command
output that will be hard to fix manually.

This is not a strict refactoring, as it changes a few strings and colors
for better consistency.
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