How can the ansible-lint warning colour be controlled?

This is a repost from the ansible-lint GitHub discussions Q&A in the hope that someone here might have an answer:

I have a terminal set to white on black, ansible-lint warnings are black on black, I have this in ansible.cfg to fix an issue like this with Ansible itself:

[colors]
debug = blue

But I can’t work out how to set the ansible-lint warning colour, can someone explain how this can be done?

I can’t find anything but the option to turn all color off (–nocolor)…

1 Like

I couldn’t either, apart from --force-color which is handy for places where a non-interactive terminal is detected and you want colour, for example with GitLab CI.

ansible-lint --help | grep color
                    [--enable-list ENABLE_LIST] [--nocolor] [--force-color]
  --nocolor             disable colored output, same as NO_COLOR=1
  --force-color         Force colored output, same as FORCE_COLOR=1

So perhaps I should raise an issue at GitHub as a feature request?

Definitely worth a try. Seems like having more color control would be a good thing.

1 Like

Thanks, have done:

1 Like

Hi @chris I had this problem with v24.12.2 and went back to v24.2.0 where it doesn’t happen ¯\_(ツ)_/¯

pipx install ansible-lint==v24.2.0 --force 
1 Like

Hi @chris I had this problem with v24.12.2 and went back to v24.10.0 where it doesn’t happen ¯\_(ツ)_/¯

pipx install ansible-lint==v24.10.0 --force