psyinfra / onyo

text-based inventory system on top of git
ISC License
3 stars 5 forks source link

DOC/BF: stylize help output with `rich` #601

Closed aqw closed 4 months ago

aqw commented 4 months ago

This PR:

This introduces a new dependency: rich-argparse

Sadly, there is no rich.RST analogue to rich.Markdown, so I intercept the help text, and convert relevant RST-isms into rich markup. It's not elegant, but functional.

Annoyingly, rich-argparse passes around rich Text objects rather than strings, which lacks basic string functionality. Thus, I need to intercept text at all three originating points, rather than the single rendering point.

If we want to remove the dependency, we could lift some pieces from the rich-argparse project (MIT licensed), and integrate our changes into them (flattening the structure by a layer).

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 93.18182% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 95.70%. Comparing base (1a013f0) to head (fb2bd66). Report is 2 commits behind head on main.

Files Patch % Lines
onyo/main.py 92.50% 2 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #601 +/- ## ========================================== - Coverage 95.73% 95.70% -0.04% ========================================== Files 71 71 Lines 5583 5608 +25 Branches 1081 1090 +9 ========================================== + Hits 5345 5367 +22 - Misses 139 141 +2 - Partials 99 100 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.