Skip to content

Support FORCE_COLOR env var #2918

@MicaelJarniac

Description

@MicaelJarniac

search you tried in the issue tracker

FORCE_COLOR, color

describe your actual problem

Add support for the FORCE_COLOR environment variable. When set, regardless of value, all output should have colors enabled, as if the terminal supported them.

pre-commit seems to support a similar env var, PRE_COMMIT_COLOR, that should have a similar effect when set to always.

FORCE_COLOR, however, seems to be basically a universal approach to this, and is being used by many other projects.

Supporting it means that one only has to set a single env var to enable colors on all tools at once automatically.

If every tool were to create its own unique env var, CI configuration would easily get too crowded and messy.

I'm not saying that PRE_COMMIT_COLOR should be deprecated, just that FORCE_COLOR should also be supported.

Some projects that use this:

Related:

pre-commit --version

pre-commit 3.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions