Skip to content

Allow styling of status, timing, and warnings text#1653

Merged
rolandwalker merged 1 commit intomainfrom
RW/allow-styling-status-warnings
Feb 28, 2026
Merged

Allow styling of status, timing, and warnings text#1653
rolandwalker merged 1 commit intomainfrom
RW/allow-styling-status-warnings

Conversation

@rolandwalker
Copy link
Contributor

Description

Allow styling of status, timing, and warnings text per settings in ~/.myclirc. The new styles are off by default, just available to change.

Warnings styles represent a set of independent header, rows, etc. for the whole warnings table. It is not yet possible to style the borders of the warnings table.

Example of styling status text:

status_styled

Example of styling the warnings table:

warnings_styled

(Styling of the status and timings text is awesome, and I will use it right away. Status of the warnings table, not so much. It would be better with the borders included.)

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Feb 28, 2026
@github-actions
Copy link

  1. Regression: timing lines are no longer written to audit log
  • In mycli/main.py, output_timing() prints directly with print_formatted_text(...) but never calls self.log_output(...).
  • Before this PR, timing output used self.echo(...) (at the two call sites now changed), which did log via log_output.
  • Impact: users with --logfile lose timing entries unexpectedly.
  • Fix: add self.log_output(timing) inside output_timing() before printing.
  1. warnings.status / warnings.timing settings are currently ineffective
  • New config keys are added in mycli/myclirc, but warning status still renders with class:output.status in mycli/main.py, and there is no warnings-specific timing path.
  • Impact: documented/visible settings appear supported but don’t affect output.
  • Fix: either wire warning-status/timing rendering to warning classes, or remove/defer these keys to avoid misleading config surface.
  1. Missing tests for introduced behavior
  • PR only updates config fixture (test/myclirc); no tests validate:
    • styled status/timing rendering paths,
    • warnings-style remapping path (is_warnings_style=True),
    • timing logging regression case.
  • Recommend adding focused unit tests in test_main.py / test_clistyle.py for these new code paths.

Couldn’t run tests in this environment (pytest/uv not available), so review is static-analysis only.

@rolandwalker rolandwalker force-pushed the RW/allow-styling-status-warnings branch 3 times, most recently from 35a3666 to e5ffaaa Compare February 28, 2026 13:38
per settings in ~/.myclirc.  The new styles are off by default, just
available to change.

Warnings styles represent a set of independent header, rows, etc. for
the whole warnings table.  It is not yet possible to style the borders
of the warnings table.  For consistency, timings were added to warnings,
which previously were not shown.

This requires updating some tests to use a different method for
capturing the standard output.  Otherwise we get an error from deep
within prompt_toolkit.
@rolandwalker rolandwalker force-pushed the RW/allow-styling-status-warnings branch from e5ffaaa to 2c0f2aa Compare February 28, 2026 22:58
@rolandwalker rolandwalker merged commit 6b390f2 into main Feb 28, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/allow-styling-status-warnings branch February 28, 2026 23:02
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