Skip to content

Commit

Permalink
Detect role argument_specs files as a lintable kind (#2091)
Browse files Browse the repository at this point in the history
Beginning with ansible version 2.11 role argument validation based on an
argument specification was introduced. This specification is defined in
the meta/argument_specs.yml file of a role.

This change enables the linter to detect this new format and for it to
be used in future rules.

Fixes: #1688
Relates: #1966

Signed-off-by: Daniel Ziegenberg <[email protected]>
  • Loading branch information
ziegenberg authored May 3, 2022
1 parent bce29ae commit 6ffd7a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ansiblelint/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{"handlers": "**/handlers/*.{yaml,yml}"},
{"vars": "**/{host_vars,group_vars,vars,defaults}/**/*.{yaml,yml}"},
{"meta": "**/meta/main.{yaml,yml}"},
{"arg_specs": "**/roles/**/meta/argument_specs.{yaml,yml}"}, # role argument specs
{"yaml": ".config/molecule/config.{yaml,yml}"}, # molecule global config
{
"requirements": "**/molecule/*/{collections,requirements}.{yaml,yml}"
Expand Down
1 change: 1 addition & 0 deletions test/test_file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def test_discover_lintables_umlaut(monkeypatch: MonkeyPatch) -> None:
"roles/foo/molecule/scenario3/collections.yml",
"requirements",
), # requirements
("roles/foo/meta/argument_specs.yml", "arg_specs"), # role argument specs
# tasks files:
("tasks/directory with spaces/main.yml", "tasks"), # tasks
("tasks/requirements.yml", "tasks"), # tasks
Expand Down

0 comments on commit 6ffd7a8

Please sign in to comment.