From 6a37290cec669785d011e992569be9ed32c5e175 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 29 Oct 2023 17:25:59 -0700 Subject: [PATCH] ruff: Fix SIM114 Combine `if` branches using logical `or` operator. Signed-off-by: Anders Kaseorg --- zulip/integrations/codebase/zulip_codebase_mirror | 4 +--- zulip_bots/zulip_bots/bots/google_search/google_search.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/zulip/integrations/codebase/zulip_codebase_mirror b/zulip/integrations/codebase/zulip_codebase_mirror index 65bfcc5a..26e367f8 100755 --- a/zulip/integrations/codebase/zulip_codebase_mirror +++ b/zulip/integrations/codebase/zulip_codebase_mirror @@ -247,9 +247,7 @@ def handle_event(event: Dict[str, Any]) -> None: pass elif event_type == "wiki_page": logging.warning("Wiki page notifications not yet implemented") - elif event_type == "sprint_creation": - logging.warning("Sprint notifications not yet implemented") - elif event_type == "sprint_ended": + elif event_type in ("sprint_creation", "sprint_ended"): logging.warning("Sprint notifications not yet implemented") else: logging.info("Unknown event type %s, ignoring!", event_type) diff --git a/zulip_bots/zulip_bots/bots/google_search/google_search.py b/zulip_bots/zulip_bots/bots/google_search/google_search.py index 758157e4..579e96c6 100644 --- a/zulip_bots/zulip_bots/bots/google_search/google_search.py +++ b/zulip_bots/zulip_bots/bots/google_search/google_search.py @@ -51,9 +51,7 @@ def get_google_result(search_keywords: str) -> str: search_keywords = search_keywords.strip() - if search_keywords == "help": - return help_message - elif search_keywords == "" or search_keywords is None: + if search_keywords in ("help", ""): return help_message else: try: