-
Notifications
You must be signed in to change notification settings - Fork 652
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
literal-compare: false positive inside strings - conflict with bash code #470
Comments
Since the rule description specifically calls out the use of True/False in |
The issue seems to become even worse, another false positive found at https://github.com/kubernetes-sigs/kubespray/blob/a5edd0d709f28507635771cefae43790f4265f20/roles/kubernetes-apps/network_plugin/kube-router/tasks/main.yml#L15 and for this one I have no idea about how to avoid it. |
Agreed @awcrosby, the rule should only be evaluated against Jinja2 expressions. I just got hit by this bug on the following task:
ansible-lint, suddenly developing strong opinions about AWK programs, had this to say:
Go home, ansible-lint, you're drunk. There's no way rules 601 or 602 should be inspecting the interior of @ssbarnea are you able to add E602 to the issue title? |
Seeing similar: - name: Find empty password fields in /etc/shadow
shell: 'awk -F: ''($2 == "" ) { print $1 }'' /etc/shadow'
register: empty_password_fields
changed_when: empty_password_fields.stdout_lines | length > 0 |
Refactor rule to only look inside when conditions and avoid using line-parser. Fixes: #470
Refactor rule to only look inside when conditions and avoid using line-parser. Fixes: #470
Simple example that replicates the bug
It seems that the linter is looking for this piece of code without even knowing if that is a string or a value evaluated by ansible.
This bug makes the entire E601 rule something to add to the skip_list.
The text was updated successfully, but these errors were encountered: