fix linting

This commit is contained in:
Robert Kaussow 2023-06-28 09:17:10 +02:00
parent 8834d1e1d8
commit 357606e1e9
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
4 changed files with 5 additions and 6 deletions

View File

@ -191,7 +191,7 @@ class Candidate:
if sid:
standard_id = f"[{sid}] "
return standard_id # noqa
return standard_id
def __repr__(self):
return f"{type(self).__name__} ({self.path})"

View File

@ -304,7 +304,7 @@ class StandardBase(metaclass=StandardExtendedMeta):
return "\n".join([f"{self.candidate}:{error}" for error in self.errors])
class StandardLoader():
class StandardLoader:
def __init__(self, source):
self.rules = []

View File

@ -209,11 +209,10 @@ def template(basedir, value, variables, fail_on_undefined=False, **kwargs):
# Hack to skip the following exception when using to_json filter on a variable.
# I guess the filter doesn't like empty vars...
with suppress(AnsibleError, ValueError):
value = ansible_template(
return ansible_template(
os.path.abspath(basedir), value, variables,
**dict(kwargs, fail_on_undefined=fail_on_undefined)
)
return value
def play_children(basedir, item, parent_type):
@ -373,8 +372,7 @@ def rolename(filepath):
if idx < 0:
return ""
role = filepath[idx + 6:]
role = role[:role.find("/")]
return role
return role[:role.find("/")]
def _kv_to_dict(v):

View File

@ -118,6 +118,7 @@ ignore = [
"D203",
"D212",
"UP038",
"RUF012",
]
line-length = 99
select = [