Skip to content

refactor(status): replace colorama/tabulate with Rich#335

Merged
jimisola merged 6 commits intomainfrom
fix/status-rich-rendering
Mar 22, 2026
Merged

refactor(status): replace colorama/tabulate with Rich#335
jimisola merged 6 commits intomainfrom
fix/status-rich-rendering

Conversation

@jimisola
Copy link
Member

@jimisola jimisola commented Mar 22, 2026

Summary

  • Replaces all manual ANSI escape codes (colorama) and tabulate table rendering in status.py with the Rich library (Table, Text, Columns, Console)
  • Also replaces colorama/tabulate in semantic_validator._log_all_errors() with Rich
  • Removes colorama and tabulate from project dependencies; adds rich>=13.0
  • status.py reduced from 323 → 212 lines

Layout

  • REQUIREMENTS table: DOUBLE_EDGE box, row separators, legend as centered caption
  • IMPLEMENTATIONS section: bold white header centered above two side-by-side tables:
    • In Code — Total / Implemented / Verified / Not Verified
    • Not in Code — Total / Verified / Not Verified
  • Tests / SVCs section: two side-by-side tables:
    • Total Tests: N — Passed / Failed / Skipped
    • Total SVCs: N — SVCs missing tests / SVCs missing MVRs
Screenshot From 2026-03-22 23-17-50

Test plan

  • hatch run dev:pytest tests/unit/reqstool/commands/status/ -v — 19 tests pass
  • hatch run dev:pytest tests/unit --tb=short — all unit tests pass
  • hatch run dev:flake8 src/reqstool/commands/status/status.py — clean
  • hatch run dev:black src/reqstool/commands/status/status.py — clean
  • Visual smoke test against ms-001 and reqstool-demo fixtures

…d semantic_validator.py

- Replace manual ANSI escape codes and tabulate table rendering with Rich
  library (Panel, Table, Text, Console) in status.py (~323 → 255 lines)
- Replace colorama/tabulate in semantic_validator._log_all_errors() with Rich
- Remove colorama and tabulate from project dependencies; add rich>=13.0
- Update test_status_presentation.py: remove colorama dependency, add _render()
  helper, update assertions to check Text.plain/.style and rendered ANSI codes
- Keep _ORANGE and _DIM as named constants (now Rich color name strings)

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…d, separator before totals, Code/NA inside impl table

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…arators, Code/NA and Tests/SVCs as 2-cell boxes

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
- Replace colorama/tabulate svc table with two side-by-side Rich tables:
  Total Tests (Passed/Failed/Skipped) and Total SVCs (missing tests/MVRs)
- Center IMPLEMENTATIONS header above In Code / Not in Code tables using
  two-pass render+measure approach
- Make IMPLEMENTATIONS, In Code, Not in Code headers plain white (not
  colored green/red based on completion)
- Use legend as table caption (centered automatically by Rich)
- Add empty line before IMPLEMENTATIONS section

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
@jimisola jimisola self-assigned this Mar 22, 2026
@jimisola
Copy link
Member Author

jimisola commented Mar 22, 2026

@Jonas-Werne FYI. With this in place we should be able to work on #311 now. Shall we call the current output verbose and add the SVC things you mentioned? Comment in #311.

- black reformatted status.py
- removed unused Text and _ORANGE imports from test file
- deleted PLAN_CODE_SMELLS.md (all items resolved)

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
@jimisola jimisola merged commit 858fc0c into main Mar 22, 2026
7 checks passed
@jimisola jimisola deleted the fix/status-rich-rendering branch March 22, 2026 22:49
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