mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-22 04:40:42 +00:00
refactor: additional code quality improvements (#78)
This commit is contained in:
parent
3ae0e358c0
commit
72d85b002b
@ -200,7 +200,7 @@ class Candidate(object):
|
||||
or filename.endswith(".py")
|
||||
):
|
||||
return Code(filename, settings, standards)
|
||||
if "inventory" == basename or "hosts" == basename or parentdir in ["inventories"]:
|
||||
if basename == "inventory" or basename == "hosts" or parentdir in ["inventories"]:
|
||||
return Inventory(filename, settings, standards)
|
||||
if "rolesfile" in basename or "requirements" in basename:
|
||||
return Rolesfile(filename, settings, standards)
|
||||
|
@ -28,7 +28,7 @@ class CheckShellInsteadCommand(StandardBase):
|
||||
cmd = " ".join(task["action"].get("__ansible_arguments__", []))
|
||||
|
||||
unjinja = re.sub(r"\{\{[^\}]*\}\}", "JINJA_VAR", cmd)
|
||||
if not any([ch in unjinja for ch in "&|<>;$\n*[]{}?"]):
|
||||
if not any(ch in unjinja for ch in "&|<>;$\n*[]{}?"):
|
||||
errors.append(self.Error(task["__line__"], self.helptext))
|
||||
|
||||
return self.Result(candidate.path, errors)
|
||||
|
@ -63,7 +63,7 @@ def lines_ranges(lines_spec):
|
||||
|
||||
|
||||
def is_line_in_ranges(line, ranges):
|
||||
return not ranges or any([line in r for r in ranges])
|
||||
return not ranges or any(line in r for r in ranges)
|
||||
|
||||
|
||||
def safe_load(string):
|
||||
|
Loading…
Reference in New Issue
Block a user