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

[Feature Request] forced color output for text format #1122

Open
asdkant opened this issue Jan 30, 2024 · 0 comments
Open

[Feature Request] forced color output for text format #1122

asdkant opened this issue Jan 30, 2024 · 0 comments

Comments

@asdkant
Copy link

asdkant commented Jan 30, 2024

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

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

No branches or pull requests

1 participant