-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add option to force color output #7771
Copy link
Copy link
Closed
Description
mypy ignores color_output=true if there is no tty, but in a CI context color is often supported and desired even though there's no tty. pytest solves this with a tri-state flag: --color=yes/no/auto, where color=auto is equivalent to mypy's color_output=true, and color=yes forces color on.
chad$ pytest --help | grep color
--color=color color terminal output (yes/no/auto).
I'm happy to submit a PR for this if you think it makes sense.
There is the issue of backward compatibility. We have a few options
- introduce a new flag
--color=yes/no/autoand deprecate the old boolean one. This would let us maintain backward compatibility for a few versions while people switch over - change the type of
--color-output/--no-color-outputto enum string. This would break backward compatibility, at least for the CLI. We might be able to hack something to work for config files.
Reactions are currently unavailable