Skip to content

Commit 774edb4

Browse files
committed
ruff: Fix C400 Unnecessary generator (rewrite as a list comprehension).
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 353c2de commit 774edb4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tools/custom_check.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
{"pattern": r"\t", "description": "Fix tab-based whitespace"},
99
]
1010

11-
markdown_whitespace_rules = list(
12-
rule for rule in whitespace_rules if rule["pattern"] != r"[\t ]+$"
13-
) + [
11+
markdown_whitespace_rules: List[Rule] = [
12+
*(rule for rule in whitespace_rules if rule["pattern"] != r"[\t ]+$"),
1413
# Two spaces trailing a line with other content is okay--it's a markdown line break.
1514
# This rule finds one space trailing a non-space, three or more trailing spaces, and
1615
# spaces on an empty line.

zulip/integrations/zephyr/zephyr_mirror_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def add_zulip_subscriptions(verbose: bool) -> None:
10121012

10131013
if len(zephyr_subscriptions) != 0:
10141014
res = zulip_client.add_subscriptions(
1015-
list({"name": stream} for stream in zephyr_subscriptions),
1015+
[{"name": stream} for stream in zephyr_subscriptions],
10161016
authorization_errors_fatal=False,
10171017
)
10181018
if res.get("result") != "success":

0 commit comments

Comments
 (0)