diff --git a/src/ansiblelint/utils.py b/src/ansiblelint/utils.py index 4862b8a720..6d76f6a7bf 100644 --- a/src/ansiblelint/utils.py +++ b/src/ansiblelint/utils.py @@ -822,7 +822,7 @@ def _extend_with_roles(lintables: List[Lintable]) -> None: role = lintable.path while role.parent.name != "roles" and role.name: role = role.parent - if role.exists: + if role.exists and not role.is_file(): lintable = Lintable(role, kind="role") if lintable not in lintables: _logger.debug("Added role: %s", lintable)