From 6a4ad8861ba51116c08bad1a51d99c185cf88deb Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 29 Oct 2023 17:09:23 -0700 Subject: [PATCH] ruff: Fix SIM103 Return the condition directly. Signed-off-by: Anders Kaseorg --- zulip_bots/zulip_bots/bots/merels/libraries/mechanics.py | 7 +++---- zulip_bots/zulip_bots/bots/yoda/yoda.py | 5 +---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/zulip_bots/zulip_bots/bots/merels/libraries/mechanics.py b/zulip_bots/zulip_bots/bots/merels/libraries/mechanics.py index 3093f882..9501211d 100644 --- a/zulip_bots/zulip_bots/bots/merels/libraries/mechanics.py +++ b/zulip_bots/zulip_bots/bots/merels/libraries/mechanics.py @@ -570,10 +570,9 @@ def can_take_mode(topic_name, merels_storage): updated_hill_uid = get_hills_numbers(updated_grid) - if current_hill_uid != updated_hill_uid and len(updated_hill_uid) >= len(current_hill_uid): - return True - else: - return False + return bool( + current_hill_uid != updated_hill_uid and len(updated_hill_uid) >= len(current_hill_uid) + ) def check_moves(turn, grid): diff --git a/zulip_bots/zulip_bots/bots/yoda/yoda.py b/zulip_bots/zulip_bots/bots/yoda/yoda.py index 4e1cfc5d..4ae410a7 100644 --- a/zulip_bots/zulip_bots/bots/yoda/yoda.py +++ b/zulip_bots/zulip_bots/bots/yoda/yoda.py @@ -124,10 +124,7 @@ class YodaSpeakHandler: def is_help(self, original_content: str) -> bool: # gets rid of whitespace around the edges, so that they aren't a problem in the future message_content = original_content.strip() - if message_content == "help": - return True - else: - return False + return message_content == "help" handler_class = YodaSpeakHandler