Make handling of `FORCE_COLOR` environment variable match the emerging standard by AlexWaygood · Pull Request #13853 · python/mypy · GitHub
Skip to content

Make handling of FORCE_COLOR environment variable match the emerging standard - #13853

Closed
AlexWaygood wants to merge 1 commit into
python:masterfrom
AlexWaygood:force-color
Closed

AlexWaygood wants to merge 1 commit into
python:masterfrom
AlexWaygood:force-color

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Oct 9, 2022

Copy link
Copy Markdown
Member

See the conversation in https://github.com/python/mypy/pull/13814/files#r990652344: the emerging standard for this is to treat the presence of the FORCE_COLOR environment variable as indicating that color is desired, even if the variable is set to "0" or "False". This PR makes mypy's behaviour here match the behaviour of pytest, nox, rich and pypa/build in how they all handle this environment variable.

(It doesn't match the behaviour of tox, but tox seems to be on its own here.)

@github-actions

github-actions Bot commented Oct 9, 2022

Copy link
Copy Markdown
Contributor

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's actually some thought out standard and not just tired maintainers merging quick PRs, let's treat FORCE_COLOR=0 as not forcing colour. Setting env vars to 0 or 1 is about as standard as it gets and it's weird that it's inconsistent with MYPY_FORCE_COLOR. Also looks like it's not just tox, it's node too.

@AlexWaygood

Copy link
Copy Markdown
Member Author

it's weird that it's inconsistent with MYPY_FORCE_COLOR

Yeah, that's fair. I don't really have a strong opinion one way or another :)

@hugovk might have some thoughts!

@hugovk

hugovk commented Oct 12, 2022

Copy link
Copy Markdown
Member

@AlexWaygood
AlexWaygood deleted the force-color branch October 19, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants