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.48k stars 657 forks source link

skip_list: - yaml[indentation] doesn't work #4344

Open alexiszamanidis opened 1 month ago

alexiszamanidis commented 1 month ago

Hello,

I want to express my gratitude for the excellent linter you've developed.

I'd like to report an issue regarding the skip_list feature, specifically with:

# .ansible-lint
skip_list:
  - yaml[indentation]

I've added it to my .ansible-lint file, but it doesn't seem to skip these checks as expected. You can review the issue in the following commit where the indentation is enforced after running ansible-lint.

Could you please confirm if I'm missing something or if this might be a bug?

Additionally, I'm curious if there's a way to specify the number of spaces for indentation, as I couldn't find any documentation on this.

Any guidance on this matter would be greatly appreciated.

alisonlhart commented 2 days ago

We reviewed the commit and noticed you're using --fix. When using the fix feature, skipping yaml tests generally does not work. We will update our documentation to indicate this, as it currently isn't clear in docs. Thank you for reporting this!

alexiszamanidis commented 2 days ago

Hi @alisonlhart

Thank you for the clarification! It’s good to know that YAML tests don’t currently work with "--fix". Including this in the documentation will definitely help others avoid confusion in the future.

If there’s any workaround or if the feature is planned to be supported in the future, please let me know. I’d be interested in testing YAML as part of "--fix".

Thanks again for looking into this!