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

Rule no-tabs being triggered in lineinfile module calls #3010

Closed
hegyibalint opened this issue Feb 10, 2023 · 1 comment · Fixed by #3021
Closed

Rule no-tabs being triggered in lineinfile module calls #3010

hegyibalint opened this issue Feb 10, 2023 · 1 comment · Fixed by #3021
Assignees
Labels
bug new Triage required

Comments

@hegyibalint
Copy link

Issue detected on 6.12.2.dev0
Issue verified on HEAD (6.12.2.dev15)

Summary

According to no-tab's documentation:

This rule does not trigger alerts for tab characters in the ansible.builtin.lineinfile module.

  • In playbooks, this is the behavior.
  • In roles, the rule will trigger nonetheless.
Issue Type
  • Bug Report
OS / ENVIRONMENT

OS: Arch Linux

Ansible-lint version:

ansible-lint --version
ansible-lint 6.12.2.dev0 using ansible 2.14.2
You are using a pre-release version of ansible-lint.

(As mentioned, it also happens on master)

  • ansible installation method: pacman -S ansible (i.e. OS package)
  • ansible-lint installation method: pacman -S ansible-lint (i.e. OS package)
STEPS TO REPRODUCE

https://github.com/hegyibalint/ansible-lint-no-tab-fail-reproducer

Desired Behavior

The rule should not be triggered in lineinfile module calls

@hegyibalint hegyibalint added bug new Triage required labels Feb 10, 2023
@ssbarnea
Copy link
Member

ssbarnea commented Feb 11, 2023

My (personal) opinion is that if tabs are required in YAML strings, they should always be escaped as \t, as otherwise it is too likely for them to not be noticed or to accidentally be changed to spaces.

Unless that is not really possible to achieve, I would say this this bug is likely to be sorted by just improving the documentation on this rule.

PS. Kudos for testing with main branch! ;)

@ssbarnea ssbarnea self-assigned this Feb 12, 2023
ssbarnea added a commit that referenced this issue Feb 13, 2023
ssbarnea added a commit that referenced this issue Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new Triage required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants