-
Notifications
You must be signed in to change notification settings - Fork 35
pretty print tables with rich #1246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
55cd89a to
f3c92a3
Compare
|
I vote it is pretty by default and we can add a |
IAlibay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
News item!
mikemhenry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you just haven't written tests yet (since it is a draft) but I think that is the only thing missing
|
Oh yes and +1 for a news item, but that can wait until the dust settles on how we want to do this and what new flags exist |
42b0c7a to
e695053
Compare
mikemhenry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! One test question and needs a news item but other than that LGTMM!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1246 +/- ##
==========================================
- Coverage 92.75% 92.73% -0.03%
==========================================
Files 141 141
Lines 10813 10845 +32
==========================================
+ Hits 10030 10057 +27
- Misses 783 788 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
oh and a test for the rich printing as well |
this is tricky because I'll need to mock the terminal width, since that affects text wrapping. do you know how to do this off the top of your head? otherwise i'll open an issue to follow up later, and leave it as a smoke test for now. |
f875b9f to
5004dbf
Compare
|
Fine with a smoke test, this is how you can capture the output: from io import StringIO
from rich.console import Console
console = Console(file=StringIO())
console.print("[bold red]Hello[/] World")
str_output = console.file.getvalue()I think we have a few "levels" of testing:
I am happy with 3, but I think if 1 takes you 30 minutes it would be worth it. |
|
No API break detected ✅ |
mikemhenry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh btw since the smoke test is in there, I will give this an approval so it can get merged in now
downstream of #1244
I'm open to making this a
--prettyflag if we want to preserve backwards compatibility. This would be a good idea if users regularly use>> output.csvinstead of-o output.csv. This isn't anything we suggest in the docs, so I'm not sure if it's something people actually do.Checklist
newsentryDevelopers certificate of origin