-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Extract a symlink's target type if possible, so it can have proper colors. #563
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #563 +/- ##
==========================================
- Coverage 86.73% 86.38% -0.36%
==========================================
Files 37 37
Lines 3800 3819 +19
==========================================
+ Hits 3296 3299 +3
- Misses 504 520 +16
Continue to review full report at Codecov.
|
oh, my bad, I got you wrong! could you add some tests for this feature and we can pass the CI |
Hey, what sort of tests would you like? Since it's pretty much just pattern matching. |
@@ -120,6 +151,7 @@ mod tests { | |||
fn test_symlink_render_default_invalid_target_withcolor() { |
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.
like the test here, it checks the invalid target color, IMO, you can add some tests like this testing some of newly added cases
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.
Maybe It looks a little dumb by adding tests for pattern matching, but this is how we kept the functionalities working as expected during the code changes.
We should probably colors the items using lscolors and not just builtin colors. |
@meain the coloring is using the default mechanism, it would already use the LSCOLOR if I get the coloring logic right. |
Ahh, my bad I misread what the code was doing. @dsully I found a small issue in the code. If the symlink is relative and we are not calling lsd from the same directory that it was symlinked from, it does not work.
|
Ok, I'll take a look. |
Extract a symlink's target type if possible, so it can have proper colors.
Before:
After:
cargo fmt