-
Notifications
You must be signed in to change notification settings - Fork 1.8k
disable Force color over no color #8183
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
crates/uv/src/settings.rs
Outdated
} else if matches!( | ||
args.color, | ||
ColorChoice::Always | ColorChoice::Never | ColorChoice::Auto | ||
) { | ||
// If `--color` is passed explicitly, use the value of `args.color` directly. | ||
args.color |
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.
Won't this always match since the default is "auto" at the clap-level?
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.
Yupp, But I thought if --color
is passed explicitly, we can use the value of args.color
directly.
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.
Also, when I tested the expected result was coming for all three separate cases. Means for FORCE_COLOR
and --color
and with sub arguments.
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.
Won't this always match since the default is "auto" at the clap-level?
Done purposely, as when the user does not anything (neither the environment variables nor the --color), then I wanted the auto property. As If --color
is given, it doesn't matter the value, we can always use them.
Unless I'm missing something, I believe this changes standard behavior since env var should still take priority over cli when honoring the order of For example, if you have |
Should it? Honestly not sure. |
Fair, I was considering CI scenarios when I said this. Wouldn't this be a breaking if changed? |
The docs (https://no-color.org/) at least state that "per-instance command-line arguments should override the NO_COLOR environment variable". |
Does the same apply for FORCE_COLOR? Or CLICOLOR_FORCE? |
Sounds like it does at least for I've likely been using it wrong 😆 To me, its a bit vague since the relationship between Sounds like
What about an explicit |
Yeah, agree with this @samypr100:
I think |
@Aditya-PS-05 - Do you plan to pursue the follow-up changes mentioned here? |
@charliermarsh |
6721092
to
738d2be
Compare
All the required changes are done in the pr #8215 |
closes #8173