ruff: Enable import sorting, replacing isort.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-11-15 21:45:45 -08:00 committed by Tim Abbott
parent 06e64e5713
commit 9a8a2bd345
4 changed files with 11 additions and 11 deletions

View File

@ -105,6 +105,7 @@ select = [
"C", # comprehensions "C", # comprehensions
"E", # style errors "E", # style errors
"F", # flakes "F", # flakes
"I", # import sorting
"M", # meta "M", # meta
"N", # naming "N", # naming
"U", # upgrade "U", # upgrade
@ -127,4 +128,8 @@ ignore = [
"N818", # Exception name should be named with an Error suffix "N818", # Exception name should be named with an Error suffix
] ]
line-length = 100 line-length = 100
src = [".", "tools", "tools/setup/emoji"]
target-version = "py38" target-version = "py38"
[tool.ruff.isort]
known-third-party = ["zulip"]

View File

@ -169,13 +169,6 @@ def run() -> None:
["tools/commit-message-lint"], ["tools/commit-message-lint"],
description="Checks commit messages for common formatting errors (config: .gitlint)", 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( linter_config.external_linter(
"prettier", "prettier",
["node_modules/.bin/prettier", "--cache", "--check", "--log-level=warn"], ["node_modules/.bin/prettier", "--cache", "--check", "--log-level=warn"],

View File

@ -15,9 +15,8 @@ from django.core.validators import validate_email
from django.http import HttpRequest from django.http import HttpRequest
from django.urls import reverse from django.urls import reverse
from django.utils.http import urlsafe_base64_encode 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 as _
from django.utils.translation import gettext_lazy
from markupsafe import Markup from markupsafe import Markup
from two_factor.forms import AuthenticationTokenForm as TwoFactorAuthenticationTokenForm from two_factor.forms import AuthenticationTokenForm as TwoFactorAuthenticationTokenForm
from two_factor.utils import totp_digits from two_factor.utils import totp_digits

View File

@ -58,9 +58,12 @@ from zerver.lib.bot_lib import EmbeddedBotHandler, EmbeddedBotQuitException, get
from zerver.lib.context_managers import lockfile from zerver.lib.context_managers import lockfile
from zerver.lib.db import reset_queries from zerver.lib.db import reset_queries
from zerver.lib.digest import bulk_handle_digest_email 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 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.email_notifications import handle_missedmessage_emails
from zerver.lib.error_notify import do_report_error from zerver.lib.error_notify import do_report_error
from zerver.lib.exceptions import RateLimited from zerver.lib.exceptions import RateLimited