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

skip_list skips everything #4040

Open
p7kdev opened this issue Feb 21, 2024 · 2 comments
Open

skip_list skips everything #4040

p7kdev opened this issue Feb 21, 2024 · 2 comments
Labels

Comments

@p7kdev
Copy link

p7kdev commented Feb 21, 2024

Summary

Hi,

I would like to skip a specific tag completely (var-naming[no-role-prefix]). I have created the following .ansible-lint configuration

---
skip_list:
  - var-naming[no-role-prefix]

But now no check is executed at all. Everything seems ok.

If i run ansible-lint without a .ansible-lint configuration file, i will get the following ouput

                       Rule Violation Summary                        
 count tag                        profile rule associated tags       
   307 var-naming[no-role-prefix] basic   idiom                      
     1 yaml[empty-lines]          basic   formatting, yaml           
     3 yaml[indentation]          basic   formatting, yaml           
     1 yaml[key-duplicates]       basic   formatting, yaml           
     1 risky-shell-pipe           safety  command-shell              
     7 no-changed-when            shared  command-shell, idempotency 

Failed: 320 failure(s), 0 warning(s) on 75 files. Last profile that met the validation criteria was 'min'.

If I skip one tag now, I would have expected the others to still appear. But with the above config I now get the following

Passed: 0 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'production'.

But I would still like to have the other messages because I would like to fix them. Just not the one which i want to skip.

Background. I have a collection namespace.zabbix and in it several roles (agent, server, proxy, ...). Now my variables have the structure zabbix_ROLE_variable (e.g. zabbix_agent_port), but ansible-lint complains about it. (That's ok, it's defined that way). But surely this one check can be ignored somehow.

Issue Type
  • Bug Report
OS / ENVIRONMENT
ansible-lint 6.22.1 using ansible-core:2.16.3 ansible-compat:4.1.11 ruamel-yaml:0.17.40 ruamel-yaml-clib:0.2.8
  • ansible installation method: OS package (Archlinux)
  • ansible-lint installation method: OS package (Archlinux)
STEPS TO REPRODUCE

Add a simple .ansible-lint configuration with skip_list

---
skip_list:
  - var-naming[no-role-prefix]
Desired Behavior

Only the one check is ignored

Actual Behavior

Everything is ignored

@p7kdev p7kdev added bug new Triage required labels Feb 21, 2024
@ssbarnea ssbarnea removed the new Triage required label Feb 28, 2024
@ssbarnea
Copy link
Member

Please link to a minimal repository that reproduced the bug.

@Durf1985
Copy link

Durf1985 commented Mar 20, 2024

I have same problems
- yaml[trailing-spaces]
leave only
- yaml[truthy]: Truthy value should be one of
everything else for yaml is lost

If you specify this rule, then the number of warnings is 93, if you remove it, then more than 1000. Moreover, if you specify not through .ansible-lint, but through .yamllint.yml, then exactly the desired rule is excluded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

3 participants