-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(tree): Color the output #15242
base: master
Are you sure you want to change the base?
feat(tree): Color the output #15242
Conversation
This comment has been minimized.
This comment has been minimized.
7bdabca
to
61eb729
Compare
d8eb809
to
14a72df
Compare
Also need to think about artifact dependencies, which make the color choice more chaos 😬. Maybe, the color should follow on the package being inspected via As for features, what about give And yeah, |
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.
Looks good to me, though I'm not sure if everyone agrees. Should we start with nightly only first so we can iterate on the design?
So after some time, we'll have multiple nightly toolchains to compare different colorschemes all at once.
I assume those are regular edges. However, it might be interesting to draw those as dashed or something.
That is part of the user-templated string and the user could be adding their own coloring which could make things messy. We could possibly detect user colors and make our own conditioned on that. I decided to just punt on any styling of user-formatted text for now.
Nightly only is a bit annoying with some of the compile-time constants being done. |
What does this PR try to resolve?
This is an experiment to find ways to make
cargo tree
output easier to grok. I find too many details are hard to spot because everything looks the same.The goal is to make it easier to scan the output for relevant details. So far, this approach seems the most viable. Knowing what type of edges led to where you are provides useful context for scrolling through large lists of dependencies.
How should we test and review this PR?
I had considered styling normal dependency edges but there isn't a header to clarify what they mean, so I decided to match the package name as that is the header. So this didn't buy as much as I had hoped, especially since dimmed lines aren't obvious with my terminal. Maybe if we used different unicode graph characters.
Instead of coloring the "this is elided"
(*)
, I had considered using a unicode character that looks like its pointing from that item up. I only found one that looked close to that but the origin for the arrow was bottom aligned, rather than center aligned and it looked off.Alternatives considered
--invert
.split_once("::").0
) or prefix (.split_once(['-','_']).0
), assign a color (maybe only for the top N packages to reduce duplicate colors)gix-*
and similar other cases--depth
(of course,. these could be mixed)
Additional information