mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-16 10:00:39 +00:00
fix linting
This commit is contained in:
parent
8834d1e1d8
commit
357606e1e9
@ -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})"
|
||||||
|
@ -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 = []
|
||||||
|
@ -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):
|
||||||
|
@ -118,6 +118,7 @@ ignore = [
|
|||||||
"D203",
|
"D203",
|
||||||
"D212",
|
"D212",
|
||||||
"UP038",
|
"UP038",
|
||||||
|
"RUF012",
|
||||||
]
|
]
|
||||||
line-length = 99
|
line-length = 99
|
||||||
select = [
|
select = [
|
||||||
|
Loading…
Reference in New Issue
Block a user