-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Filesize simplification #76
Conversation
Add a test for a number that exceeds the largest prefix, and a test for a negative number. Both cases are handled correctly but were not tested. Signed-off-by: Beat Bolli <dev@drbeat.li>
Don't handle the "gnu" format specially, instead include the separating space directly in the unit suffix. Also just break out of the loop when the suffix is known; the final return statement is the same one as the one(s) formerly inside the loop. Signed-off-by: Beat Bolli <dev@drbeat.li>
67637ba
to
06145d2
Compare
Codecov Report
@@ Coverage Diff @@
## main #76 +/- ##
==========================================
- Coverage 99.06% 99.05% -0.01%
==========================================
Files 9 9
Lines 745 742 -3
==========================================
- Hits 738 735 -3
Misses 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Thanks for the PR! Do you know why the type checking fails?
|
Not really... My local mypy installation (v0.991) does not report any type violations in |
Hmm, the same version is used by the CI: humanize/.pre-commit-config.yaml Lines 61 to 66 in 60e3b47
Also with the |
Updated to make mypy happy. The more type-safe way is: ret = format % (base * bytes_ / unit) + s
assert isinstance(ret, str)
return ret But this shorter version is good enough for here. Thanks @AlexWaygood for the tips! |
Well, 100% to 100% is no change, and ironically by reducing the total covered lines, it's slightly decreased the total coverage percentage 🙃
but this is appreciated :) Thank you! |
Changes proposed in this pull request: