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

cli,helpers: don't always use color #233

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Mar 23, 2021

Benefits:

  • A user who writes configlet lint > output.txt will no longer see
    color codes in that file.
  • It becomes easier to write integration tests for configlet lint.

Currently when we have a PR that affects configlet lint, I check the diff that the PR makes to the output of configlet lint on every track. This PR helps to simplify that process a little.

From e.g. https://clig.dev/#output:

Disable color if your program is not in a terminal or the user requested it. These things should disable colors:

  • stdout or stderr is not an interactive terminal (a TTY). It’s best to individually check—if you’re piping stdout to another program, it’s still useful to get colors on stderr.
  • The NO_COLOR environment variable is set.
  • The TERM environment variable has the value dumb.

Benefits:
- A user who writes `configlet lint > output.txt` will no longer see
  color codes in that file.
- It becomes easier to write integration tests for `configlet lint`.
@ee7 ee7 merged commit fb040f3 into exercism:main Mar 24, 2021
@ee7 ee7 deleted the cli-dont-always-use-color branch March 24, 2021 09:54
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.

2 participants