Closed sol closed 1 year ago
@parsonsmatt this is ready to go.
Just so I understand correctly - this skips the
hedgehog
color check and instead uses thehspec
--color
and--no-color
options, where--no-color
strips out the ANSI codes.
Correct.
Hedgehog's
detectColor
function does some other logic, though, likeHEDGEHOG_COLOR
env var check and ensuring the logged in user isn'tmth
lol.I feel like we can retain the functionality here with a much broader range of
hspec
versions by detecting color as-is, and then use CPP to use eitherReason
orColorizedReason
.
If I understand you correctly, then no, I don't think that would solve my use case. If I specify --color
and e.g. redirect stdout
then detectColor
will return False
. As a consequence I will end up without colors, even though I requested them.
I'm hesitant to force consumers to upgrade to the latest
hspec
versions only for this
Do you think there is any tangible benefit from doing this, that is relevant enough to offsets the additional complexity? Note that existing users can continue to use 0.0.1.2
with older versions of hspec
.
@parsonsmatt any chance to get this merged sometime soon? Maintaining and using my private fork, which is not on Hackage, will eventually be too much overhead for me.
Sure - please make a version bump and changelog entry and I'll have it released asap. Thanks!
Sure - please make a version bump and changelog entry and I'll have it released asap. Thanks!
Done as a separate PR (#27) to not unnecessarily cause conflicts.
(relies on https://github.com/hspec/hspec/blob/main/CHANGES.markdown#changes-in-2110-2023-04-21)