mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-16 18:10:38 +00:00
22 lines
814 B
Python
22 lines
814 B
Python
|
"""Checks related to ansible specific best practices."""
|
||
|
|
||
|
from ansiblelater.command.candidates import Error
|
||
|
from ansiblelater.command.candidates import Result
|
||
|
from ansiblelater.utils.rulehelper import get_normalized_tasks
|
||
|
|
||
|
|
||
|
def check_deprecated(candidate, settings):
|
||
|
tasks, errors = get_normalized_tasks(candidate, settings, full=True)
|
||
|
description = "'{old}' is deprecated and should not be used anymore. Use '{new}' instead."
|
||
|
|
||
|
if not errors:
|
||
|
for task in tasks:
|
||
|
if "skip_ansible_lint" in task.get("tags"):
|
||
|
errors.append(
|
||
|
Error(
|
||
|
task["__line__"],
|
||
|
description.format(old="skip_ansible_lint", new="skip_ansible_later")
|
||
|
)
|
||
|
)
|
||
|
return Result(candidate.path, errors)
|