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: if sid:
standard_id = f"[{sid}] " standard_id = f"[{sid}] "
return standard_id # noqa return standard_id
def __repr__(self): def __repr__(self):
return f"{type(self).__name__} ({self.path})" 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]) return "\n".join([f"{self.candidate}:{error}" for error in self.errors])
class StandardLoader(): class StandardLoader:
def __init__(self, source): def __init__(self, source):
self.rules = [] 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. # Hack to skip the following exception when using to_json filter on a variable.
# I guess the filter doesn't like empty vars... # I guess the filter doesn't like empty vars...
with suppress(AnsibleError, ValueError): with suppress(AnsibleError, ValueError):
value = ansible_template( return ansible_template(
os.path.abspath(basedir), value, variables, os.path.abspath(basedir), value, variables,
**dict(kwargs, fail_on_undefined=fail_on_undefined) **dict(kwargs, fail_on_undefined=fail_on_undefined)
) )
return value
def play_children(basedir, item, parent_type): def play_children(basedir, item, parent_type):
@ -373,8 +372,7 @@ def rolename(filepath):
if idx < 0: if idx < 0:
return "" return ""
role = filepath[idx + 6:] role = filepath[idx + 6:]
role = role[:role.find("/")] return role[:role.find("/")]
return role
def _kv_to_dict(v): def _kv_to_dict(v):

View File

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