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

Fix patterns used to identify var files #1360

Merged
merged 1 commit into from Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/group_vars/all.yml
@@ -0,0 +1 @@
some_var: some_value_defined_in_group_vars_all
1 change: 1 addition & 0 deletions examples/host_vars/localhost.yml
@@ -0,0 +1 @@
some_var: some_value_defined_in_host_vars_localhost
1 change: 1 addition & 0 deletions examples/playbooks/vars/other.yml
@@ -0,0 +1 @@
some_var: some_value_defined_in_vars_other
1 change: 1 addition & 0 deletions examples/playbooks/vars/subfolder/settings.yml
@@ -0,0 +1 @@
some_var: some_value_defined_in_vars_subfolder_settings
2 changes: 1 addition & 1 deletion src/ansiblelint/config.py
Expand Up @@ -20,7 +20,7 @@
{"role": "**/roles/*/"},
{"tasks": "**/tasks/*.{yaml,yml}"},
{"handlers": "**/handlers/*.{yaml,yml}"},
{"vars": "**/{vars,defaults}/*.{yaml,yml}"},
{"vars": "**/{host_vars,group_vars,vars,defaults}/**/*.{yaml,yml}"},
{"meta": "**/meta/main.{yaml,yml}"},
{"yaml": ".config/molecule/config.{yaml,yml}"}, # molecule global config
{"yaml": "**/molecule/*/molecule.{yaml,yml}"}, # molecule config
Expand Down
4 changes: 4 additions & 0 deletions test/TestUtils.py
Expand Up @@ -349,6 +349,10 @@ def test_is_playbook():
# Undeterminable files:
("test/fixtures/unknown-type.yml", "yaml"),
("releasenotes/notes/run-playbooks-refactor.yaml", "reno"), # reno
("examples/host_vars/localhost.yml", "vars"),
("examples/group_vars/all.yml", "vars"),
("examples/playbooks/vars/other.yml", "vars"),
("examples/playbooks/vars/subfolder/settings.yml", "vars"), # deep vars
),
)
def test_auto_detect(monkeypatch, path: str, kind: FileType) -> None:
Expand Down