mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-16 01:50:39 +00:00
cleanup
This commit is contained in:
parent
b3f2e601b1
commit
912b351a7d
@ -5,7 +5,7 @@ from ansiblelater.utils import load_plugin
|
||||
class CheckFQCNBuiltin(RuleBase):
|
||||
rid = "ANS128"
|
||||
helptext = "use FQCN `{module_alias}` for module action `{module}`"
|
||||
description = "Actions should use full qualified collection names"
|
||||
description = "Module actions should use full qualified collection names"
|
||||
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars"]
|
||||
module_aliases = {
|
||||
"block": "block",
|
||||
@ -92,7 +92,6 @@ class CheckFQCNBuiltin(RuleBase):
|
||||
|
||||
for task in tasks:
|
||||
module = task["action"]["__ansible_module_original__"]
|
||||
print(module)
|
||||
|
||||
if module not in self.module_aliases:
|
||||
loaded_module = load_plugin(module)
|
||||
|
@ -123,8 +123,8 @@ class Settings:
|
||||
"include_filter": [],
|
||||
"exclude_filter": [],
|
||||
"warning_filter": [
|
||||
"ANS128",
|
||||
"ANS999",
|
||||
"ANS998",
|
||||
],
|
||||
"ignore_dotfiles": True,
|
||||
"exclude_files": [],
|
||||
|
@ -415,6 +415,7 @@ def normalize_task(task, filename, custom_modules=None):
|
||||
# about short calls
|
||||
normalized["action"] = {
|
||||
"__ansible_module__": action.removeprefix("ansible.builtin."),
|
||||
"__ansible_module_original__": action,
|
||||
}
|
||||
|
||||
if "_raw_params" in arguments:
|
||||
|
@ -77,8 +77,8 @@ rules:
|
||||
# List of rule ID's that should be displayed as a warning instead of an error. By default,
|
||||
# no rules are marked as warnings. This list allows to degrade errors to warnings for each rule.
|
||||
warning_filter:
|
||||
- "ANS128"
|
||||
- "ANS999"
|
||||
- "ANS998"
|
||||
|
||||
# All dotfiles (including hidden folders) are excluded by default.
|
||||
# You can disable this setting and handle dotfiles by yourself with `exclude_files`.
|
||||
|
@ -43,4 +43,5 @@ Reviews are useless without some rules to check against. `ansible-later` comes w
|
||||
| CheckRelativeRolePaths | ANS125 | Don't use a relative path in a role. | |
|
||||
| CheckChangedInWhen | ANS126 | Use handlers instead of `when: changed`. | |
|
||||
| CheckChangedInWhen | ANS127 | Deprecated bare variables in loops must not be used. | |
|
||||
| CheckFQCNBuiltin | ANS128 | Module actions should use full qualified collection names. | |
|
||||
| CheckDeprecated | ANS999 | Deprecated features of `ansible-later` should not be used. | |
|
||||
|
Loading…
Reference in New Issue
Block a user