Skip to content

Commit

Permalink
add new default lintable kind arg_specs for role argument validation …
Browse files Browse the repository at this point in the history
…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: ansible#1688
Relates: ansible#1966

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
  • Loading branch information
ziegenberg committed May 1, 2022
1 parent e52dfe3 commit 91e3016
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:
WSLENV: FORCE_COLOR:PYTEST_REQPASS:TOXENV:TOX_PARALLEL_NO_SPINNER
# Number of expected test passes, safety measure for accidental skip of
# tests. Update value if you add/remove tests.
PYTEST_REQPASS: 608
PYTEST_REQPASS: 609

steps:
- name: Activate WSL1
Expand Down
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 91e3016

Please sign in to comment.