-
Notifications
You must be signed in to change notification settings - Fork 692
Skip yamllint warnings #2248
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 yamllint warnings #2248
Conversation
Set match.ignored to True on all sub-error level issues that get reported from yamllint
@dthomson-triumf I do have the impression that you are trying to fix something that does not need to be fixed. As far the linter is concerned any message from yamllint is an error. We do not care if yamllint is configured to treat them as errors or warnings, for us all of them are violations. If you want to make ansible-lint to treat a specific yamllint rule as a warning, you can add these to |
I thought that #1794 indicated that this was a bug that needs fixing? Regardless, using the The following setup: # playbook.yml
---
- hosts: localhost
tasks:
- name: Here is a long task
ansible.builtin.command: echo "This is the output from a very long command that's not going to make ansible-lint very happy"
changed_when: false # .ansible-lint
---
warn_list:
- yaml[list-length] # .yamllint
---
rules:
line-length:
level: warning
max: 80 Still gives me: me@myhost:~/ansible-lint-warns$ ansible-lint
WARNING Listing 1 violation(s) that are fatal
yaml: line too long (130 > 80 characters) (yaml[line-length])
playbook.yml:5
You can skip specific rules or tags by adding them to your configuration file:
# .config/ansible-lint.yml
warn_list: # or 'skip_list' to silence them completely
- yaml # Violations reported by yamllint.
Finished with 1 failure(s), 0 warning(s) on 1 files. Only using: warn_list:
- yaml Treats the |
You can now add entries like `yaml[document-start]` to the skip_list or warn_list, instead of adding the entire rule, allowing you to have more granular filtering. Closes: ansible#2248 Closes: ansible#1794
You can now add entries like `yaml[document-start]` to the skip_list or warn_list, instead of adding the entire rule, allowing you to have more granular filtering. Closes: ansible#2248 Closes: ansible#1794
* Add ability to use use sub-rule matches on skip or warn lists You can now add entries like `yaml[document-start]` to the skip_list or warn_list, instead of adding the entire rule, allowing you to have more granular filtering. Closes: #2248 Closes: #1794 * Update src/ansiblelint/rules/yaml.md Co-authored-by: Jacob Floyd <[email protected]> * Update .ansible-lint Co-authored-by: Jacob Floyd <[email protected]> * Update src/ansiblelint/app.py Co-authored-by: Jacob Floyd <[email protected]> Co-authored-by: Jacob Floyd <[email protected]>
Hi, I saw that #1794 was marked with a "good first issue" tag, so I thought I'd try doing a small fix for this bug that I just ran up against.
The PR should be fairly straightforward to read, though I'm not sure if this is along the lines of what you might be looking for with a solution. Comments, suggestions and concerns are all welcome.
Thanks!