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 Version Sort #843

Merged
merged 8 commits into from
Jul 6, 2023
Merged

Add Version Sort #843

merged 8 commits into from
Jul 6, 2023

Conversation

juansc
Copy link
Contributor

@juansc juansc commented Apr 30, 2023

Description

Addresses #801. The root cause is that the external library that is being used does not have sufficient test coverage and is no longer maintained.

I took a look at how GNU sort is implemented and it looked simple enough to be included into this repo. I added a few test cases, including the one from the issue.

I'm still pretty new to Rust, so any code/organizational feedback is greatly appreciated


TODO

  • Use cargo fmt
  • Add necessary tests (You tell me 🙂)
  • Add changelog entry
  • Update default config/theme in README (if applicable)
  • Update man page at lsd/doc/lsd.md (if applicable)

@juansc
Copy link
Contributor Author

juansc commented Apr 30, 2023

It looks like I have some refactoring artifacts. I'll fix and add more documentation

@codecov-commenter
Copy link

codecov-commenter commented May 2, 2023

Codecov Report

Merging #843 (858e437) into master (71156b8) will increase coverage by 0.02%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master     #843      +/-   ##
==========================================
+ Coverage   86.52%   86.54%   +0.02%     
==========================================
  Files          49       49              
  Lines        4840     4840              
==========================================
+ Hits         4188     4189       +1     
+ Misses        652      651       -1     
Impacted Files Coverage Δ
src/sort.rs 98.00% <ø> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/sort.rs Outdated
use human_sort::compare;
use crate::versionsort::compare;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you didn't meant to simply remove human-sort, but this is what you are doing here.

Did you forget to implement some cli / config switch ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do mean to replace the sorting library. The new code is now its own separate crate and the PR now reflects that.

@muniu-bot
Copy link

muniu-bot bot commented Jun 25, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: juansc

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@juansc
Copy link
Contributor Author

juansc commented Jun 30, 2023

I think it's cleaner to break out the sorting logic into a separate crate. Once it's published I'll update this PR to use that crate instead. The code in the create has been updated and has more robust testing

@juansc juansc requested a review from zwpaper as a code owner June 30, 2023 23:59
@zwpaper
Copy link
Member

zwpaper commented Jul 4, 2023

hi @juansc, I have read the PR and vsort crate, and it seems great!

please add a changelog here https://github.com/lsd-rs/lsd/blob/master/CHANGELOG.md and we should be good to go.

/lgtm

@muniu-bot muniu-bot bot added the lgtm label Jul 4, 2023
@muniu-bot muniu-bot bot removed the lgtm label Jul 4, 2023
@muniu-bot
Copy link

muniu-bot bot commented Jul 4, 2023

New changes are detected. LGTM label has been removed.

@juansc
Copy link
Contributor Author

juansc commented Jul 4, 2023

@zwpaper Changelog has been added

@zwpaper zwpaper merged commit 4514713 into lsd-rs:master Jul 6, 2023
@zwpaper
Copy link
Member

zwpaper commented Jul 6, 2023

thanks so much @juansc

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.

4 participants