-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: multiple characters for rule.py #207
Conversation
Codecov Report
@@ Coverage Diff @@
## master #207 +/- ##
==========================================
+ Coverage 97.85% 98.42% +0.56%
==========================================
Files 50 50
Lines 3783 3930 +147
==========================================
+ Hits 3702 3868 +166
+ Misses 81 62 -19
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I was able to get the cell sizes of emoji, but had some trouble with printing emoji, |
There's not much you can do re overlapping emoji I'm afraid, it depends on the terminal. Try other emoji / terminals to see if there is a difference. Not sure where your extra new line is coming from. |
I've just tried the emoji rule in my own terminal and there aren't any overlaps anymore. But the last emoji gets broken onto the next line, because of the 2 cell length it has (same goes to Chinese characters for |
Ah, I see why there was an extra newline. The text was longer than the width of the terminal and it wrapped. have a look at I do think it's worthwhile to handle these edge cases. If only so I have less issues to respond to. |
I have fixed the extra newline, do you think we should add tests for emoji? Since you said the overlapping can differ due to different terminals I haven’t added them yet I’m also not quite sure about the CONTRIBUTORS.md, people have contributed but no one has added them in it yet |
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.
I think we'll need a few changes.
Most of the stuff in Rich has turned out to be trickier than you might think. Especially when cell length is taken in to consideration!
Thanks, I'll have a look at your changes soon. Working on 5.1.0 this weekend. |
@hedythedev This looks good. All we need is to add 'character' back in to the interface and we should be good to merge. |
The only problem now, is that I did not add tests for line 31 (as the coverage states) because then you will also have to remove the test when the next major bump takes place, so the coverage for rule will be 98%. If you think it’s fine I will add them for both rule and console |
One option would be to do this: characters = character or characters Without the branch, coverage won't see that as a miss. But you could argue that's a hack to avoid a test. tbh I don't think it will make much difference either way. Happy to merge. Thanks for your contribution. I have branch I've been working on and I should be able to get the new rule in the next minor version, hopefully today or tomorrow. |
Would it be necessary to add me to CONTRIBUTORS.md? I think I forgot to do that |
Yes please. I’d like to keep track of contributors there. |
Type of changes
(Removing these other options so progress bar of pr can show proper progress)
Checklist
Description
Resolves #204
Add support for multiple characters param in printing a horizontal rule, supported emoji sizing and cjk printing. Added tests.