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 if it is set. #154

Merged
merged 1 commit into from
Jan 4, 2021
Merged

Respect the NO_COLOR environment variable if it is set. #154

merged 1 commit into from
Jan 4, 2021

Conversation

asmaloney
Copy link
Contributor

If set, this will turn off colourization of the output.

See https://no-color.org/

Fixes #90

If set, this will turn off colourization of the output.

See https://no-color.org/

Fixes #90
@codecov
Copy link

codecov bot commented Jan 2, 2021

Codecov Report

Merging #154 (eea6cbf) into master (6297c3b) will decrease coverage by 0.82%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #154      +/-   ##
==========================================
- Coverage   83.27%   82.45%   -0.83%     
==========================================
  Files          20       20              
  Lines        1160     1060     -100     
==========================================
- Hits          966      874      -92     
+ Misses        174      166       -8     
  Partials       20       20              
Impacted Files Coverage Δ
issues/issue.go 100.00% <ø> (ø)
main.go 0.00% <0.00%> (ø)
output/error.go 0.00% <0.00%> (-18.19%) ⬇️
htmltest/util.go 50.00% <0.00%> (-5.56%) ⬇️
htmldoc/attr.go 93.75% <0.00%> (-2.25%) ⬇️
issues/issue_store.go 91.11% <0.00%> (-2.00%) ⬇️
htmldoc/document.go 87.17% <0.00%> (-1.46%) ⬇️
htmltest/check-generic.go 81.08% <0.00%> (-1.42%) ⬇️
htmldoc/document_store.go 95.23% <0.00%> (-0.92%) ⬇️
refcache/refcache.go 94.59% <0.00%> (-0.76%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6297c3b...eea6cbf. Read the comment docs.

@asmaloney
Copy link
Contributor Author

I have no idea how to write test coverage for this change. If you need something, please let me know what you'd like done.

Copy link
Owner

@wjdp wjdp left a comment

Choose a reason for hiding this comment

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

Cheers! Don't worry about tests for this, standard suite doesn't cover the main.go file yet.

@wjdp wjdp merged commit 8785ad8 into wjdp:master Jan 4, 2021
@asmaloney
Copy link
Contributor Author

Thanks for the great tool!

I've just realized I forgot to add info about this to the README. Would you like me to do so?

Would it also make sense to add a ColourizeOutput option to the config file? With the environment variable taking precedence?

@wjdp
Copy link
Owner

wjdp commented Jan 4, 2021

Thanks for the contribution!

Change to README and config option would be welcome.

For config option name I'd go for LogColour or LogColourise to group with other log options.

@wjdp
Copy link
Owner

wjdp commented Jan 4, 2021

Thinking about it am now unsure on want for config option as well because:

  • Having colour is more personal preference than project dependant. Env var fits better here.
  • Having one way of doing something (in this case and env var) is less confusing than having multiple ways of doing something.

@asmaloney
Copy link
Contributor Author

OK - sounds good. I'll update the README.

@asmaloney asmaloney deleted the no-colour branch March 23, 2021 02:18
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.

Allow disabling of coloured output
2 participants