# How can the ansible-lint warning colour be controlled?

**URL:** <https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511>\
**Category:** Get Help\
**Tags:** ansible-lint\
**Created:** [January 8, 2025, 6:21pm UTC](https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511 "2025-01-08T18:21:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [January 8, 2025, 6:21pm UTC](https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511/1 "2025-01-08T18:21:15Z")

</div>

This is a repost from the [ansible-lint GitHub discussions Q&A](https://github.com/ansible/ansible-lint/discussions/4461) 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:
> 
> ```ini
> [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?

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [January 9, 2025, 9:37pm UTC](https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511/2 "2025-01-09T21:37:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [January 9, 2025, 9:44pm UTC](https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511/3 "2025-01-09T21:44:54Z")

</div>

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.

```bash
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?

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [January 10, 2025, 4:55pm UTC](https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511/4 "2025-01-10T16:55:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [January 10, 2025, 6:09pm UTC](https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511/5 "2025-01-10T18:09:14Z")

</div>

Thanks, have done:

> <https://github.com/ansible/ansible-lint/issues/4469>
>
> I have a terminal set to white on black, \`ansible-lint\` warnings are black on bl…ack, I have this in \`ansible.cfg\` to fix an issue like this with Ansible itself:
> 
> \`\`\`ini
> \[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?
> 
> \_Originally posted by @chriscroome in https://github.com/ansible/ansible-lint/discussions/4461\_
> 
> \_Discussed on the Ansible Forum in https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511\_

---

<div class="post-metadata">

**Author:** ![OSiUX](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/osiux/32/263_2.png) [@OSiUX](https://forum.ansible.com/u/OSiUX)\
**Post date:** [January 15, 2025, 9:53pm UTC](https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511/6 "2025-01-15T21:53:52Z")

</div>

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

```auto
pipx install ansible-lint==v24.2.0 --force 

```

---

<div class="post-metadata">

**Author:** ![OSiUX](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/osiux/32/263_2.png) [@OSiUX](https://forum.ansible.com/u/OSiUX)\
**Post date:** [January 15, 2025, 10:13pm UTC](https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511/7 "2025-01-15T22:13:57Z")

</div>

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

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

```

> <https://github.com/ansible/ansible-lint/issues/4469#issuecomment-2594038579>
>
> I have a terminal set to white on black, \`ansible-lint\` warnings are black on bl…ack, I have this in \`ansible.cfg\` to fix an issue like this with Ansible itself:
> 
> \`\`\`ini
> \[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?
> 
> \_Originally posted by @chriscroome in https://github.com/ansible/ansible-lint/discussions/4461\_
> 
> \_Discussed on the Ansible Forum in https://forum.ansible.com/t/how-can-the-ansible-lint-warning-colour-be-controlled/39511\_
