-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 .cargo/config settings to control output colors #2367
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR @oconnor663! The implementation here looks good to me, it's just largely a question of design now. Some suggestions I might have are:
Today the terms "status color" and "status bold" make sense, but it may not always have a meaning in future iterations of Cargo's UI. I'm not sure that there's really a great way to resolve this, and there's two ways to go here I think. On one hand we can make the configuration here generic (e.g. "bold = true", "color = green"), and then try to interpret that wherever possible. On the other hand we could make it super specific (e.g. as-is with the term "status") and then simply not interpret the keys in the future if we change the UI. I think I would personally lean a bit more towards the more-generic aspects so we can hopefully take existing configurations into account for future UI changes, but I'm curious as to your thoughts as well! As to the PR itself, could you add a few more pieces as well?
|
I got a chance to talk with @wycats about this today and some thoughts were:
|
That all sounds good, thanks for following up. I'll probably get back to this "sometime in the next few weeks", so if anyone is itching to take it over in the meantime, that's totally cool too. |
☔ The latest upstream changes (presumably #2480) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing due to inactivity, but feel free to resubmit with a rebase! |
#2290
This is my first time submitting a Rust PR, so please give me lots of corrections. An example
~/.cargo/config
file setting these options would be:I picked the config names more or less at random, so I'm happy to change those. I went with the simple approach of adding an extra condition to our current use of
Attr::Bold
, but we could also consider letting the color strings represent boldness/brightness on their own.Naive question for the folks who know more about Rust and this code: why is it that
Config
contains a bunch ofRefCell
s rather than owning its data directly?