ansible / ansible-lint

ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you
https://ansible.readthedocs.io/projects/lint/
GNU General Public License v3.0
3.46k stars 656 forks source link

ansible-lint does not respect yamllint error level #4355

Open Hipska opened 2 weeks ago

Hipska commented 2 weeks ago
Summary

Rules for yamllint set to warning aren't automatically warnings in ansible-lint as well. It only does that when the rule is also added to warn_list, which is duplicating configs.

Issue Type
OS / ENVIRONMENT
ansible-lint --version
ansible-lint 24.9.2 using ansible-core:2.17.4 ansible-compat:24.9.1 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
STEPS TO REPRODUCE

.yamllint

---

rules:
  line-length:
    level: warning
    allow-non-breakable-inline-mappings: true
Desired Behavior
yaml[line-length]: Line too long (413 > 80 characters) (warning)
initiate.yml:25

yaml[line-length]: Line too long (413 > 80 characters) (warning)
initiate.yml:29
Actual Behavior
yaml[line-length]: Line too long (413 > 80 characters)
initiate.yml:25

yaml[line-length]: Line too long (413 > 80 characters)
initiate.yml:29
Qalthos commented 3 days ago

This seems like an ask for reasonable behavior. We do look at .yamllint, so we could use that to inform the level of yaml rules, though I'm not sure how complicated that would be.