-
Notifications
You must be signed in to change notification settings - Fork 2.7k
refactor: Centralize some more styling #16124
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
Conversation
| pub const UPDATE_DOWNGRADED: Style = WARN; | ||
| pub const UPDATE_UNCHANGED: Style = anstyle::Style::new().bold(); | ||
|
|
||
| pub const DEP_NORMAL: Style = anstyle::Style::new().effects(anstyle::Effects::DIMMED); |
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.
My primary goal with this is having a central place to document this for other applications
Do you mean we'll have doc comments for each, or code itself is self-documented?
Ask because I don't think the variable names here describe the intent clear if not looking into the implementation
But anyway, having styles in one place is great.
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.
Do you mean we'll have doc comments for each, or code itself is self-documented?
Not quite either. I more care about having this specified in a central location to copy/paste from. annotate-snippets makes that copy/pasting more complex but oh well.
This is similar to rust-lang#16124 in making it easier for others to see what styles cargo uses and copy them.
### What does this PR try to resolve? This is similar to #16124 in making it easier for others to see what styles cargo uses and copy them. ### How to test and review this PR?
Update cargo submodule 7 commits in 367fd9f213750cd40317803dd0a5a3ce3f0c676d..344c4567c634a25837e3c3476aac08af84cf9203 2025-10-15 15:01:32 +0000 to 2025-10-21 21:29:43 +0000 - refactor: Centralize CONTEXT style (rust-lang/cargo#16135) - chore(triagebot): `A-json-output` for machine_message.rs (rust-lang/cargo#16133) - refactor: JSON message with less allocations (rust-lang/cargo#16130) - More warning conversions (rust-lang/cargo#16126) - fix(check): Fix suggested command for bin package (rust-lang/cargo#16127) - fix(script): Remove name sanitiztion outside what is strictly required (rust-lang/cargo#16120) - refactor: Centralize some more styling (rust-lang/cargo#16124) r? ghost
What does this PR try to resolve?
On its own, this does nothing. These styles aren't used anywhere else and so this doesn't increase re-use.
My primary goal with this is having a central place to document this for other applications to track that want to mirror our style. In particular, I'm hoping to take advantage of the
UPDATEcolors in rustup.This also makes it easier for us to audit all of the values for consistency.
How to test and review this PR?