Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #505 +/- ##
==========================================
- Coverage 99.70% 99.29% -0.42%
==========================================
Files 12 15 +3
Lines 1024 1136 +112
==========================================
+ Hits 1021 1128 +107
- Misses 3 8 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #184
This PR adds a way to format file sizes directly from the terminal using Humanize. Previously, running
python -m humanize naturalsize 8589934592produced an error because the package had no command-line entry point. With this change, it prints8.6 GB.The CLI supports both
humanize naturalsizeandpython -m humanize naturalsize, along with binary units, GNU formatting, custom number formats, and piped input. Invalid input produces a helpful error message instead of a traceback.The implementation uses the existing naturalsize function for formatting. I also added CLI tests and updated the README and filesize documentation with examples.
I tested the changes locally on macOS. The test suite finished with 757 passed and 132 skipped. I also checked both command forms manually and confirmed the expected decimal and binary output.
The full aggregate lint check was blocked in the implementation environment by an npm certificate error while installing Prettier.