Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
ruff: Fix SIM201 Use `… != …` instead of `not … == …`.
Anders Kaseorg7a7513f6e090
diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_cron_file b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_cron_fileindex b766dea927c..2f3f66f71df 100755--- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_cron_file+++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_cron_file@@ -26,7 +26,7 @@ def nagios_from_file(results_file: str, max_time_diff: int = 60 * 2) -> Tuple[inelse:pieces = data.split("|")- if not len(pieces) == 4:+ if len(pieces) != 4:state = "UNKNOWN"ret = 3data = "Results file malformed"diff --git a/tools/lib/html_branches.py b/tools/lib/html_branches.pyindex 5f34987b7bd..94ac8e51500 100644--- a/tools/lib/html_branches.py+++ b/tools/lib/html_branches.py@@ -63,12 +63,12 @@ def split_for_id_and_class(element: str) -> List[str]:if ch == "}":outside_braces = Trueif ch == " " and outside_braces:- if not s == "":+ if s != "":lst.append(s)s = ""else:s += ch- if not s == "":+ if s != "":lst.append(s)return lstdiff --git a/tools/lib/pretty_print.py b/tools/lib/pretty_print.pyindex 2ba50b52556..bb29bd5ac87 100644--- a/tools/lib/pretty_print.py+++ b/tools/lib/pretty_print.py@@ -154,7 +154,7 @@ def validate_indent_html(fn: str, tokens: List[Token], fix: bool) -> bool:with open(fn) as f:html = f.read()phtml = pretty_print_html(tokens, fn)- if not html.split("\n") == phtml.split("\n"):+ if html.split("\n") != phtml.split("\n"):if fix:print(GREEN + f"Automatically fixing indentation for {fn}" + ENDC)with open(fn, "w") as f:diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.pyindex aa268690ce7..19587c4ba67 100644--- a/zerver/lib/markdown/__init__.py+++ b/zerver/lib/markdown/__init__.py@@ -1756,9 +1756,8 @@ class MarkdownListPreprocessor(markdown.preprocessors.Preprocessor):fence_str = m.group("fence")lang: Optional[str] = m.group("lang")is_code = lang not in ("quote", "quoted")- has_open_fences = not len(open_fences) == 0matches_last_fence = (- fence_str == open_fences[-1].fence_str if has_open_fences else False+ fence_str == open_fences[-1].fence_str if open_fences else False)closes_last_fence = not lang and matches_last_fencediff --git a/zerver/models.py b/zerver/models.pyindex bb4804ce5b3..b490f3f1860 100644--- a/zerver/models.py+++ b/zerver/models.py@@ -2030,7 +2030,7 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings): # typeallowed_bot_types = []if (self.is_realm_admin- or not self.realm.bot_creation_policy == Realm.BOT_CREATION_LIMIT_GENERIC_BOTS+ or self.realm.bot_creation_policy != Realm.BOT_CREATION_LIMIT_GENERIC_BOTS):allowed_bot_types.append(UserProfile.DEFAULT_BOT)allowed_bot_types += [@@ -3070,7 +3070,7 @@ class Draft(models.Model):to = []for r in get_display_recipient(self.recipient):assert not isinstance(r, str) # It will only be a string for streams- if not r["id"] == self.user_profile_id:+ if r["id"] != self.user_profile_id:to.append(r["id"])return {"id": self.id,diff --git a/zerver/webhooks/taiga/view.py b/zerver/webhooks/taiga/view.pyindex 193694587ff..f1a05d0e491 100644--- a/zerver/webhooks/taiga/view.py+++ b/zerver/webhooks/taiga/view.py@@ -263,7 +263,7 @@ def parse_change_event(change_type: str, message: WildValue) -> Optional[EventTyif not tamed_old:event_type = "set_" + change_typevalues["new"] = tamed_new- elif not tamed_old == tamed_new:+ elif tamed_old != tamed_new:event_type = change_typevalues.update(old=tamed_old, new=tamed_new)else: