Skip to content
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

Respect the NO_COLOR environment variable to disable default color output #280

Open
generalmimon opened this issue Aug 23, 2023 · 1 comment
Labels
feature a feature which should be implemented hacktoberfest

Comments

@generalmimon
Copy link
Contributor

There is an informal standard described at https://no-color.org/ aimed at command-line programs that produce color output by default to respect the NO_COLOR environment variable to disable default color output. It would be nice if editorconfig-checker followed it too. It does use colors by default, and there is the -no-color command-line option to disable that, but I see the benefit of joining other numerous command-line tools listed at https://no-color.org/#software-directly-supporting-no_color-to-disable-color-output-by-default so that users can easily disable color in many applications at once.

One small problem in context of editorconfig-checker - since the color output is default, there is only the -no-color flag to turn it off, but there isn't an option to turn color on. For programs supporting NO_COLOR, it seems to be expected, see https://no-color.org/#frequently-asked-questions:

2. How should configuration files and command-line arguments be processed in the presence of $NO_COLOR?

User-level configuration files and per-instance command-line arguments should override $NO_COLOR. A user should be able to export $NO_COLOR in their shell configuration file as a default, but configure a specific program in its configuration file to specifically enable color.

So I think such option allowing to override NO_COLOR setting and turn colors back on should be added - if there is already -no-color to disable colors, maybe -color could enable them?

@mstruebing
Copy link
Member

I highly agree, thanks for the suggestion.
If you want feel free to create a PR that implements this behaviour - otherwise I see when I will have some time.

@per1234 per1234 added the feature a feature which should be implemented label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature which should be implemented hacktoberfest
Projects
None yet
Development

No branches or pull requests

3 participants