diff --git a/pyproject.toml b/pyproject.toml index 4a83f2ceb3..f8f27066dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,6 +105,7 @@ select = [ "C", # comprehensions "E", # style errors "F", # flakes + "I", # import sorting "M", # meta "N", # naming "U", # upgrade @@ -127,4 +128,8 @@ ignore = [ "N818", # Exception name should be named with an Error suffix ] line-length = 100 +src = [".", "tools", "tools/setup/emoji"] target-version = "py38" + +[tool.ruff.isort] +known-third-party = ["zulip"] diff --git a/tools/lint b/tools/lint index 519e03cc31..ff8e2ea7d4 100755 --- a/tools/lint +++ b/tools/lint @@ -169,13 +169,6 @@ def run() -> None: ["tools/commit-message-lint"], description="Checks commit messages for common formatting errors (config: .gitlint)", ) - linter_config.external_linter( - "isort", - ["isort"], - ["py", "pyi"], - description="Sorts Python import statements", - check_arg=["--check-only", "--diff"], - ) linter_config.external_linter( "prettier", ["node_modules/.bin/prettier", "--cache", "--check", "--log-level=warn"], diff --git a/zerver/forms.py b/zerver/forms.py index 868164d323..f7ae6bfa3d 100644 --- a/zerver/forms.py +++ b/zerver/forms.py @@ -15,9 +15,8 @@ from django.core.validators import validate_email from django.http import HttpRequest from django.urls import reverse from django.utils.http import urlsafe_base64_encode -from django.utils.translation import get_language +from django.utils.translation import get_language, gettext_lazy from django.utils.translation import gettext as _ -from django.utils.translation import gettext_lazy from markupsafe import Markup from two_factor.forms import AuthenticationTokenForm as TwoFactorAuthenticationTokenForm from two_factor.utils import totp_digits diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index b474e4f1f3..c2aba93878 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -58,9 +58,12 @@ from zerver.lib.bot_lib import EmbeddedBotHandler, EmbeddedBotQuitException, get from zerver.lib.context_managers import lockfile from zerver.lib.db import reset_queries from zerver.lib.digest import bulk_handle_digest_email -from zerver.lib.email_mirror import decode_stream_email_address, is_missed_message_address +from zerver.lib.email_mirror import ( + decode_stream_email_address, + is_missed_message_address, + rate_limit_mirror_by_realm, +) from zerver.lib.email_mirror import process_message as mirror_email -from zerver.lib.email_mirror import rate_limit_mirror_by_realm from zerver.lib.email_notifications import handle_missedmessage_emails from zerver.lib.error_notify import do_report_error from zerver.lib.exceptions import RateLimited