Ignore var-naming[pattern] to foreign role vars #4230
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4095.
When working on this issue, I ran into another bug when writing a test case to test my solution to the issue. The bug I ran into was when running a test case that would lint a playbook from
./examples/playbooks
that contained ainclude_role
/import_role
task with a FQCN role as its argument. I noticed that the test case would pick up violations from other lintables that I didn't specify as an argument to myrunner
instance. I suspect this is because_rolepath
currently doesn't handle FQCNs, which results in thebasedir
being returned and can cause_look_for_role_files
to return additional unexpected files. This can be seen when runningpytest test/test_utils.py::test_find_children_in_playbook
from another fork branch I made to showcase this https://github.com/cavcrosby/ansible-lint/tree/ignore-foreign-role-vars-revert-utils. The changes to fix said bug are consolidated intoutils.py
.To add, said bug probably won't affect an end user unless they purposefully contain violations in their Ansible yaml like in the case of
ansible-lint
. That said, I would think we would want to address this for development purposes.