Skip to content
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

add support for --non-human-readable flag #589

Merged
merged 13 commits into from
Apr 26, 2023

Conversation

ayushpoddar
Copy link
Contributor

@ayushpoddar ayushpoddar commented Apr 18, 2023

Description

This PR adds support for the flag --non-human-readable. Using this flag will display the file sizes in bytes, not converted to a human friendly format.

Tasks performed in this PR:

  • Add support for showing file sizes in bytes in long format. Use the --nh or --non-human-readable flag.
  • Update the README accordingly (with screenshot)
  • Update the "MINOR" component of the version as per the Semantic Versioning specification. Why?
    • This PR adds a new feature in a backwards-compatible manner.

Other information

@ayushpoddar ayushpoddar marked this pull request as ready for review April 19, 2023 12:11
@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.25 🎉

Comparison is base (3ad436b) 91.79% compared to head (5f3b880) 92.04%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #589      +/-   ##
==========================================
+ Coverage   91.79%   92.04%   +0.25%     
==========================================
  Files           8        8              
  Lines         597      616      +19     
==========================================
+ Hits          548      567      +19     
  Misses         49       49              
Impacted Files Coverage Δ
lib/colorls/core.rb 93.11% <100.00%> (+0.45%) ⬆️
lib/colorls/flags.rb 89.59% <100.00%> (+0.12%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ayushpoddar
Copy link
Contributor Author

@avdv What can we do about the failing test?

Copy link
Collaborator

@avdv avdv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thank you @ayushpoddar !

lib/colorls/core.rb Outdated Show resolved Hide resolved
lib/colorls/flags.rb Outdated Show resolved Hide resolved
spec/fixtures/two_megabyte_file.txt Outdated Show resolved Hide resolved
@avdv
Copy link
Collaborator

avdv commented Apr 24, 2023

@avdv What can we do about the failing test?

I think we just need to increase the number of allowed lines, change /(.*\n){3}/ to /(.*\n){4}/ for that test.

@avdv
Copy link
Collaborator

avdv commented Apr 24, 2023

And could you add an OK colorls --long --non-human-readable check to test/checks please?

@ayushpoddar ayushpoddar requested a review from avdv April 26, 2023 13:14
Copy link
Collaborator

@avdv avdv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@avdv avdv merged commit d1e28ed into athityakumar:main Apr 26, 2023
@avdv avdv linked an issue Apr 30, 2023 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option for NOT human readable size - show file size in bytes
3 participants