Commit c66178a0 by Mathieu Kniewallner Committed by Randy Döring

refactor: remove unnecessary maps to respect `C417`

parent 837dd3fa
......@@ -26,7 +26,7 @@ class SourceShowCommand(Command):
self.line("No sources configured for this project.")
return 0
if names and not any(map(lambda s: s.name in names, sources)):
if names and not any(s.name in names for s in sources):
self.line_error(f"No source found with name(s): {', '.join(names)}")
return 1
......
......@@ -384,7 +384,7 @@ class Authenticator:
logger.debug(
"Multiple source configurations found for %s - %s",
parsed_url.netloc,
", ".join(map(lambda c: c.name, candidates)),
", ".join(c.name for c in candidates),
)
# prefer the more specific path
candidates.sort(
......
......@@ -41,10 +41,9 @@ url : https://two.com
default : no
secondary : no
""".splitlines()
assert (
list(map(lambda l: l.strip(), tester.io.fetch_output().strip().splitlines()))
== expected
)
assert [
line.strip() for line in tester.io.fetch_output().strip().splitlines()
] == expected
assert tester.status_code == 0
......@@ -57,10 +56,9 @@ url : https://one.com
default : no
secondary : no
""".splitlines()
assert (
list(map(lambda l: l.strip(), tester.io.fetch_output().strip().splitlines()))
== expected
)
assert [
line.strip() for line in tester.io.fetch_output().strip().splitlines()
] == expected
assert tester.status_code == 0
......@@ -78,10 +76,9 @@ url : https://two.com
default : no
secondary : no
""".splitlines()
assert (
list(map(lambda l: l.strip(), tester.io.fetch_output().strip().splitlines()))
== expected
)
assert [
line.strip() for line in tester.io.fetch_output().strip().splitlines()
] == expected
assert tester.status_code == 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment