Skip to content

Commit f18aee2

Browse files
committed
add new default lintable kind arg_specs for role argument validation based on argument specification
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 <daniel@ziegenberg.at>
1 parent e52dfe3 commit f18aee2

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/ansiblelint/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
{"handlers": "**/handlers/*.{yaml,yml}"},
2323
{"vars": "**/{host_vars,group_vars,vars,defaults}/**/*.{yaml,yml}"},
2424
{"meta": "**/meta/main.{yaml,yml}"},
25+
{"arg_specs": "**/roles/**/meta/argument_specs.{yaml,yml}"}, # role argument specs
2526
{"yaml": ".config/molecule/config.{yaml,yml}"}, # molecule global config
2627
{
2728
"requirements": "**/molecule/*/{collections,requirements}.{yaml,yml}"

test/test_file_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ def test_discover_lintables_umlaut(monkeypatch: MonkeyPatch) -> None:
165165
"roles/foo/molecule/scenario3/collections.yml",
166166
"requirements",
167167
), # requirements
168+
("roles/foo/meta/argument_specs.yml", "arg_specs"), # role argument specs
168169
# tasks files:
169170
("tasks/directory with spaces/main.yml", "tasks"), # tasks
170171
("tasks/requirements.yml", "tasks"), # tasks

0 commit comments

Comments
 (0)