From bc3e6297fb8850ccb0e05c96beef98fbfabb71e8 Mon Sep 17 00:00:00 2001 From: Niko Lindroos Date: Thu, 19 Dec 2024 16:22:23 +0200 Subject: [PATCH] style(ruff): remove lint isort rule because of inconsistent results KK-1113 --- children/schema.py | 2 +- common/tests/test_qrcode_service.py | 2 +- events/notification_service.py | 4 ++-- events/utils.py | 2 +- gdpr/service.py | 2 +- hel_django_auditlog_extra/tests/test_context.py | 2 +- hel_django_auditlog_extra/tests/test_mixins.py | 2 +- kukkuu/tests/utils/jwt_utils.py | 2 +- kukkuu_mailer_admin/admin.py | 2 +- pyproject.toml | 9 +++++---- reports/api.py | 2 +- subscriptions/models.py | 2 +- users/models.py | 2 +- 13 files changed, 18 insertions(+), 17 deletions(-) diff --git a/children/schema.py b/children/schema.py index 0d9d2fd9..6f2fd18d 100644 --- a/children/schema.py +++ b/children/schema.py @@ -36,7 +36,7 @@ from users.schema import GuardianNode, LanguageEnum, validate_guardian_data from users.utils import get_communication_unsubscribe_ui_url -from .models import Child, postal_code_validator, Relationship +from .models import Child, Relationship, postal_code_validator User = get_user_model() diff --git a/common/tests/test_qrcode_service.py b/common/tests/test_qrcode_service.py index e9fcc8f2..8251cba9 100644 --- a/common/tests/test_qrcode_service.py +++ b/common/tests/test_qrcode_service.py @@ -1,6 +1,6 @@ import pytest -from common.qrcode_service import create_qrcode, QRCodeFileFormatEnum +from common.qrcode_service import QRCodeFileFormatEnum, create_qrcode from kukkuu.service import get_hashid_service diff --git a/events/notification_service.py b/events/notification_service.py index 37d0ad90..c324e258 100644 --- a/events/notification_service.py +++ b/events/notification_service.py @@ -1,8 +1,8 @@ -from typing import Tuple, TYPE_CHECKING +from typing import TYPE_CHECKING, Tuple from django.conf import settings -from common.qrcode_service import create_qrcode, MIME_TYPES, QRCodeFileFormatEnum +from common.qrcode_service import MIME_TYPES, QRCodeFileFormatEnum, create_qrcode from events.consts import NotificationType from events.utils import send_event_notifications_to_guardians diff --git a/events/utils.py b/events/utils.py index 923d1d43..7433c0e4 100644 --- a/events/utils.py +++ b/events/utils.py @@ -1,7 +1,7 @@ import logging from collections.abc import Iterable from datetime import datetime -from typing import List, Optional, TYPE_CHECKING, Union +from typing import TYPE_CHECKING, List, Optional, Union from django.conf import settings from django.db.models import QuerySet diff --git a/gdpr/service.py b/gdpr/service.py index 5ebb01b6..561a306c 100644 --- a/gdpr/service.py +++ b/gdpr/service.py @@ -1,5 +1,5 @@ import logging -from typing import Optional, TYPE_CHECKING +from typing import TYPE_CHECKING, Optional from helsinki_gdpr.types import ErrorResponse diff --git a/hel_django_auditlog_extra/tests/test_context.py b/hel_django_auditlog_extra/tests/test_context.py index 3f09c80b..20d33783 100644 --- a/hel_django_auditlog_extra/tests/test_context.py +++ b/hel_django_auditlog_extra/tests/test_context.py @@ -5,9 +5,9 @@ from django.db.models.signals import pre_save from hel_django_auditlog_extra.context import ( + AuditLogContextService, _set_request_path, auditlog_request_context_value, - AuditLogContextService, set_request_path, ) diff --git a/hel_django_auditlog_extra/tests/test_mixins.py b/hel_django_auditlog_extra/tests/test_mixins.py index 82e6b114..2c7e30dd 100644 --- a/hel_django_auditlog_extra/tests/test_mixins.py +++ b/hel_django_auditlog_extra/tests/test_mixins.py @@ -12,8 +12,8 @@ from django.test import RequestFactory from hel_django_auditlog_extra.mixins import ( - _auditlog_accessed_sent, AuditlogAdminViewAccessLogMixin, + _auditlog_accessed_sent, ) from hel_django_auditlog_extra.tests.models import DummyTestModel diff --git a/kukkuu/tests/utils/jwt_utils.py b/kukkuu/tests/utils/jwt_utils.py index e8c8b7ae..bf3017fb 100644 --- a/kukkuu/tests/utils/jwt_utils.py +++ b/kukkuu/tests/utils/jwt_utils.py @@ -1,6 +1,6 @@ import time import uuid -from typing import Optional, TYPE_CHECKING +from typing import TYPE_CHECKING, Optional from django.conf import settings from jose import jwt diff --git a/kukkuu_mailer_admin/admin.py b/kukkuu_mailer_admin/admin.py index c370dd40..9d34a2ea 100644 --- a/kukkuu_mailer_admin/admin.py +++ b/kukkuu_mailer_admin/admin.py @@ -1,7 +1,7 @@ from django.contrib import admin from django.utils.translation import gettext_lazy as _ from mailer.admin import MessageAdmin, MessageLogAdmin, show_to -from mailer.models import Message, MessageLog, RESULT_CODES +from mailer.models import RESULT_CODES, Message, MessageLog from hel_django_auditlog_extra.mixins import AuditlogAdminViewAccessLogMixin diff --git a/pyproject.toml b/pyproject.toml index 65da6ea2..9e164739 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,10 +25,11 @@ ignore = [ "E117", # "Over-indented" ] -[tool.ruff.lint.isort] -# isort options for ruff: -# https://docs.astral.sh/ruff/settings/#lintisort -order-by-type = false # Don't use type (i.e. case) to sort imports +# Removed tool.ruff.lint.isort block, because the results were inconsistent. +# [tool.ruff.lint.isort] +# # isort options for ruff: +# # https://docs.astral.sh/ruff/settings/#lintisort +# order-by-type = false # Don't use type (i.e. case) to sort imports [tool.ruff.format] docstring-code-format = true # Format code in docstrings diff --git a/reports/api.py b/reports/api.py index 30b0ea89..d31c4167 100644 --- a/reports/api.py +++ b/reports/api.py @@ -1,9 +1,9 @@ from django.db.models import Prefetch from drf_spectacular.utils import ( + OpenApiExample, extend_schema, extend_schema_serializer, extend_schema_view, - OpenApiExample, ) from rest_framework import mixins, viewsets diff --git a/subscriptions/models.py b/subscriptions/models.py index c1844bb0..8e44a28e 100644 --- a/subscriptions/models.py +++ b/subscriptions/models.py @@ -1,4 +1,4 @@ -from typing import Optional, TYPE_CHECKING, Union +from typing import TYPE_CHECKING, Optional, Union from django.core.exceptions import ValidationError from django.db import models diff --git a/users/models.py b/users/models.py index f351ec5c..d136d49c 100644 --- a/users/models.py +++ b/users/models.py @@ -1,6 +1,6 @@ import logging from datetime import datetime -from typing import Optional, TYPE_CHECKING, Union +from typing import TYPE_CHECKING, Optional, Union from django.conf import settings from django.contrib.auth import get_user_model