-
Notifications
You must be signed in to change notification settings - Fork 128
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
Detect CI environments for default no-color
value
#330
Conversation
go-supportscolor
Drone CI supports 256 colors, so color can be enabled by default, even when stdout is not a TTY.
Thank you for the PR! It would be great to enable color by default on any CI systems that support it. I believe color should already be enabled by default in any interactive terminal. I'd like to avoiding adding another dependency for this. I believe all we need is a few of the lines around here: https://github.com/jwalton/go-supportscolor/blob/198795bbe247f127f76b501948f2f41fc88b8080/supportscolor.go#L213-L215 Some systems, like CircleCI already do use color, because they properly emulate a terminal. It's also worth noting that it's always possible to enable color using |
Having it via a dependency ensures that future environments will only need to be supported in one repo instead of hundrets. I see a benefit in doing it via a dependency, even if it does "a bit more" like this one does. I planned to PR support for a the new Gitea Actions environment into In case you still don't want
|
That sounds great! Thank you for making this change!
I agree it is not very obvious right now. Hiding the |
go-supportscolor
no-color
value
I have reverted the dependency and have now effectively replicated this block. |
I think the test failure is related to it detecting the CircleCI environment, will update the fixture. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This looks great. Sorry it's taking me a while to review. Just one question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Use
go-supportscolor
to detect color support for CI environments and more, which among GitHub Actions will enable color support on number of other environments which previously could not display color at all withgotestsum
.