Skip to content

Commit 91e3016

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 91e3016

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
WSLENV: FORCE_COLOR:PYTEST_REQPASS:TOXENV:TOX_PARALLEL_NO_SPINNER
157157
# Number of expected test passes, safety measure for accidental skip of
158158
# tests. Update value if you add/remove tests.
159-
PYTEST_REQPASS: 608
159+
PYTEST_REQPASS: 609
160160

161161
steps:
162162
- name: Activate WSL1

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)