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

Feature: Add option to ignore ansible-lint warnings #20

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

gl-njanz
Copy link

@gl-njanz gl-njanz commented Apr 2, 2024

By demoting certain errors to warnings in ansible-lint (-w, warn_list:) I want to signify that I don't really care about those testcases.

AFAIK the behavior of ansible-lint is to append a string to the end of the line.

Test case

This output.txt:

somedir/somefile.yaml:16: yaml[line-length]: Line too long (313 > 160 characters) (warning)
somedir/somefile.yaml:16:16: yaml[line-length]: Line too long (313 > 160 characters) (warning)
somedir/somefile.yaml:16:27: yaml[line-length]: Line too long (192 > 160 characters) (warning)
somedir/somefile.yaml:16:27: yaml[line-length]: Line too long (192 > 160 characters) (warning)
somedir/anotherfile.yaml:7: package-latest: Package installs should not use latest.

Should result in the following XML output:

<?xml version="1.0" ?>
<testsuites>
        <testsuite errors="1" failures="0" tests="0" time="0">
                <testcase name="somedir/anotherfile.yaml-1">
                        <failure file="somedir/anotherfile.yaml" line="7" message="package-latest: Package installs should not use latest." type="Ansible Lint">package-latest: Package installs should not use latest.</failure>
                </testcase>
        </testsuite>
</testsuites>

@wasilak wasilak self-assigned this Apr 18, 2024
@gl-njanz
Copy link
Author

Hi @wasilak 👋 Is there anything you need from me to help get this merged? Just let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants