wjdp / htmltest

:white_check_mark: Test generated HTML for problems
MIT License
323 stars 54 forks source link

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

Closed asmaloney closed 3 years ago

asmaloney commented 3 years ago

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

See https://no-color.org/

Fixes wjdp/htmltest#90

codecov[bot] commented 3 years ago

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%) :arrow_down:
htmltest/util.go 50.00% <0.00%> (-5.56%) :arrow_down:
htmldoc/attr.go 93.75% <0.00%> (-2.25%) :arrow_down:
issues/issue_store.go 91.11% <0.00%> (-2.00%) :arrow_down:
htmldoc/document.go 87.17% <0.00%> (-1.46%) :arrow_down:
htmltest/check-generic.go 81.08% <0.00%> (-1.42%) :arrow_down:
htmldoc/document_store.go 95.23% <0.00%> (-0.92%) :arrow_down:
refcache/refcache.go 94.59% <0.00%> (-0.76%) :arrow_down:
... 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 commented 3 years ago

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.

asmaloney commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

asmaloney commented 3 years ago

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