From df0ed0e933c66039097e0cca41fb75c2718f700a Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 18 Feb 2021 09:13:26 +0000 Subject: [PATCH] Recognize collections.yml files Fixes: #1369 --- src/ansiblelint/config.py | 3 +++ test/TestUtils.py | 1 + 2 files changed, 4 insertions(+) diff --git a/src/ansiblelint/config.py b/src/ansiblelint/config.py index 97cd543f8d..73eeebcd2b 100644 --- a/src/ansiblelint/config.py +++ b/src/ansiblelint/config.py @@ -23,6 +23,9 @@ {"vars": "**/{host_vars,group_vars,vars,defaults}/**/*.{yaml,yml}"}, {"meta": "**/meta/main.{yaml,yml}"}, {"yaml": ".config/molecule/config.{yaml,yml}"}, # molecule global config + { + "requirements": "**/molecule/*/collections.{yaml,yml}" + }, # molecule old collection requirements (v1), ansible 2.8 only {"yaml": "**/molecule/*/molecule.{yaml,yml}"}, # molecule config {"playbook": "**/molecule/*/*.{yaml,yml}"}, # molecule playbooks {"yaml": "**/*.{yaml,yml}"}, diff --git a/test/TestUtils.py b/test/TestUtils.py index 13ce8ea07a..95d753290d 100644 --- a/test/TestUtils.py +++ b/test/TestUtils.py @@ -353,6 +353,7 @@ def test_is_playbook(): ("examples/group_vars/all.yml", "vars"), ("examples/playbooks/vars/other.yml", "vars"), ("examples/playbooks/vars/subfolder/settings.yml", "vars"), # deep vars + ("molecule/scenario/collections.yml", "requirements"), # deprecated 2.8 format ), ) def test_auto_detect(monkeypatch, path: str, kind: FileType) -> None: