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
no-tabs also triggers on managed content, not just ansible syntax #1334
Comments
Yeah, this is known and I am afraid there is no way to avoid it other than adding a This is because the tab presence is identified inside the already loaded YAMl file, so we cannot distinguish between an plain binary tab or an escaped tab Use of tabs inside yaml files is quite uncommon and I do think that adding specific noqa comments is a small price to pay for preventing accidental introduction of tabs in other places. Obviously that anyone can skip the entire tule. Maybe someone find a way to address this? ... or at least find a way to reduce the false-positives. |
I would have expected that these formatting things are part of It might be possible to ignore tabs in certain parameters of certain modules at least (e.g. |
As we identified some particular cases where use of tabs is perfectly justified, we add exceptions for these. Fixes: #1334
As we identified some particular cases where use of tabs is perfectly justified, we add exceptions for these. Fixes: #1334
Summary
When writing a line containing a tab character to a file,
ansible-lint
complains that the tasks file containing that line contains a tab character.Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
Linux (Ubuntu 18.04), though I doubt that's really relevant.
STEPS TO REPRODUCE
Lint the following playbook:
Desired Behaviour
No error, since the tab character is escaped(!) as well as part of a "payload". It is not the job of
ansible-lint
to decide how config files that are managed by Ansible should be formatted. Tab characters in templates or thefiles
folder are not affected as far as I see.I would really like to keep this error and not disable it for the whole repository (it might be a bit more thorough than
yamllint
in some places I guess), but if a character is already escaped and part of a managed file (where I can't always choose the syntax or "just use spaces") that's too far reaching in my opinion. At least only trigger on unescaped tabulators.Actual Behaviour
The text was updated successfully, but these errors were encountered: