From 774edb434e4f37a19bb82fc0acc469234fd4ab04 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 29 Oct 2023 16:56:24 -0700 Subject: [PATCH] ruff: Fix C400 Unnecessary generator (rewrite as a `list` comprehension). Signed-off-by: Anders Kaseorg --- tools/custom_check.py | 5 ++--- zulip/integrations/zephyr/zephyr_mirror_backend.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/custom_check.py b/tools/custom_check.py index 2e8efd16..9a93fa41 100644 --- a/tools/custom_check.py +++ b/tools/custom_check.py @@ -8,9 +8,8 @@ whitespace_rules: List[Rule] = [ {"pattern": r"\t", "description": "Fix tab-based whitespace"}, ] -markdown_whitespace_rules = list( - rule for rule in whitespace_rules if rule["pattern"] != r"[\t ]+$" -) + [ +markdown_whitespace_rules: List[Rule] = [ + *(rule for rule in whitespace_rules if rule["pattern"] != r"[\t ]+$"), # Two spaces trailing a line with other content is okay--it's a markdown line break. # This rule finds one space trailing a non-space, three or more trailing spaces, and # spaces on an empty line. diff --git a/zulip/integrations/zephyr/zephyr_mirror_backend.py b/zulip/integrations/zephyr/zephyr_mirror_backend.py index a2bf2acc..e71349c1 100755 --- a/zulip/integrations/zephyr/zephyr_mirror_backend.py +++ b/zulip/integrations/zephyr/zephyr_mirror_backend.py @@ -1012,7 +1012,7 @@ def add_zulip_subscriptions(verbose: bool) -> None: if len(zephyr_subscriptions) != 0: res = zulip_client.add_subscriptions( - list({"name": stream} for stream in zephyr_subscriptions), + [{"name": stream} for stream in zephyr_subscriptions], authorization_errors_fatal=False, ) if res.get("result") != "success":