codeclimate icon indicating copy to clipboard operation
codeclimate copied to clipboard

[Feature Request] forced color output for text format

Open asdkant opened this issue 2 years ago • 0 comments

I'd like a way to force color output from the text format

Context

I'm using the codeclimate/codeclimate image in a GitLab CI pipeline, and I noticed that the text output is not colorized in the context of the pipeline but it is colorized when I run it in an interactive terminal.

Diggin a bit I found #836 , but the discussion there addresses codeclimate-wrapper, this does not apply to my use case because I'm using the docker image directly, here's how I'm doing that:

docker run 
--interactive --rm \
--env CODECLIMATE_CODE="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
codeclimate/codeclimate \
analyze

The root problem here is that the code inside the docker image checks if it's in a TTY or not to decide whether to output in color, I want a way to override that check and output color regardless of that. I suppose a slight change in codeclimate-wrapper should be done to add support for this new mechanism, even if that doesn't affect my particular use case.

note: if I try to force the docker run command to run with --tty, this happens. I havent found a way to trick docker into thinking it's in a TTY even if it's not, but I suspect that it wouldn't be a good idea and the better solution would be to be able to force color output

asdkant avatar Jan 30 '24 13:01 asdkant