-
Notifications
You must be signed in to change notification settings - Fork 899
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
Support FORCE_COLOR
and NO_COLOR
#3955
Comments
Yeah good call -- I think we might respect one of these... |
Yeah we do support |
It does seem like anstream already supports |
We might need to validate the precedence here too with the command-line arguments. |
I already have I forgot to mention it earlier, CPython 3.13 also supports |
Yeah we should support it -- we also support it in Ruff for this reason. |
Thanks for looking into it in anstream @samypr100, you rock. |
FYI see also my comments on rust-cli/anstyle#192 |
Thanks @epage. For some reason |
I've raised the discrepancies in donatj/force-color.org#30 |
## Summary Closes #3955 Adds explicit support to `NO_COLOR` and `FORCE_COLOR` via GlobalSettings. The order, per specs is now `NO_COLOR` > `FORCE_COLOR` > `color`. This PR is a backup plan pending rust-cli/anstyle#192. ## Test Plan Tested all cases locally for now; I didn't see existing tests for GlobalSettings parsing.
https://force-color.org and https://no-color.org are "community standards" supported by many tools, such as ruff, pip, pytest, rich, nox, tox.
It would be nice to set the
FORCE_COLOR: 1
env var in GitHub Actions so I can have coloured output in the CI. It makes logs more readable, especially when there's a failure.uv does have a
--color
CLI option, but more and more tools are using uv behind the scenes (such as https://github.com/hynek/build-and-inspect-python-package) so I don't have direct access to the uv invocation.The text was updated successfully, but these errors were encountered: