-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
switch from termcolor
to anstream
and anstyle
#737
Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
bdc8b94
ready for some initial feedback
suaviloquence a48d569
soliciting feedback here
suaviloquence 76a13fa
Merge branch 'main' into anstyle
suaviloquence 46179f8
Merge branch 'main' into anstyle - pull from upstream
suaviloquence b21b96f
switch to `colorchoice-clap` crate for color handling
suaviloquence 08bb372
store stdout and stderr in config
suaviloquence 59dc0b2
add some tests
suaviloquence 1ad3dc3
fix clippy
suaviloquence 45fa121
(re-)add ColorChoice::global & CARGO_TERM_COLOR
suaviloquence 3a6f5bf
Merge branch 'main' into anstyle
obi1kenobi 735600e
Apply suggestions from code review
suaviloquence f043188
make `configure_color` more clear
suaviloquence 0022148
clarify rustdoc child process color setting
suaviloquence dd0207b
Merge branch 'main' into anstyle
suaviloquence a08265b
handle env vars with flags
suaviloquence e762fa5
make `Check::check_release` take &mut GlobalConfig
suaviloquence 250ec9a
Merge branch 'main' into anstyle
suaviloquence 0cc2a90
respect our color preference in `rustdoc`
suaviloquence 43c3358
minor: save config.stderr() when we use it a lot
suaviloquence 0abdff0
Merge branch 'main' into anstyle
suaviloquence File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't an explicitly passed
--color=auto
CLI flag override whateverCARGO_TERM_COLOR
is set to? I find this note a bit surprising.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.
That's a good point, and in playing around with
cargo
, that's the behavior it does. Thecolorchoice_clap
crate doesn't currently distinguish between an explicitly-passed--color=auto
and no color flag entirely. I will try right now if it works with anOption<color_choice::Color>
but if that doesn't play nice with#[clap(flatten)]
, we might have to move back to the bespoke color configuration flag that I previously had.Relevant tangent: In doing this, I discovered that the environment variable actually takes precedence over the CLI flag, unlike what we had previously done. It's only been a little while since I added the
--color
flag in general; do we want to match cargo's behavior and read the environment variable over the flag?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.
Oh that's interesting! Yes, let's match cargo's behavior then -- and ideally, let's document this if at all possible, since I imagine other people might find this a bit unexpected as well.
If we don't document it, I'd be shocked if we don't get a "bug report" on that behavior in the future.
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.
Oops, little bit of a false alarm - it looks like
cargo help
checks theCARGO_TERM_COLOR
env var but not the--color
flag - may be a tiny bug in cargo itself. When I test withCARGO_TERM_COLOR=env cargo check --color=cli
,cli
overridesenv
if it is set. However, you're right that we still need to distinguish an explicit--color=auto
from one that's not set - I'll work on that.