fix(lint): auto-fix ruff violations and tune lint rules
- Auto-fixed 4,496 lint issues (import sorting, modern syntax, etc.) - Added ignore rules for patterns intentional in this codebase: E402 (late imports), E712 (SQLAlchemy filters), B904 (raise from), SIM108/SIM105/SIM117 (readability preferences) - Added per-file ignores for tests and scripts - Excluded broken scripts/rename_terminology.py (has curly quotes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,10 @@ Tests the admin platform assignment service operations.
|
||||
import pytest
|
||||
|
||||
from app.exceptions import ValidationException
|
||||
from app.modules.tenancy.exceptions import AdminOperationException, CannotModifySelfException
|
||||
from app.modules.tenancy.exceptions import (
|
||||
AdminOperationException,
|
||||
CannotModifySelfException,
|
||||
)
|
||||
from app.modules.tenancy.services.admin_platform_service import AdminPlatformService
|
||||
|
||||
|
||||
@@ -242,8 +245,7 @@ class TestAdminPlatformServiceQueries:
|
||||
self, db, test_platform_admin, test_platform, test_super_admin, auth_manager
|
||||
):
|
||||
"""Test getting admins for a platform."""
|
||||
from app.modules.tenancy.models import AdminPlatform
|
||||
from app.modules.tenancy.models import User
|
||||
from app.modules.tenancy.models import AdminPlatform, User
|
||||
|
||||
service = AdminPlatformService()
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import pytest
|
||||
from app.modules.tenancy.models.merchant_domain import MerchantDomain
|
||||
from app.modules.tenancy.models.store_domain import StoreDomain
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# MODEL TESTS
|
||||
# =============================================================================
|
||||
|
||||
@@ -6,11 +6,9 @@ from datetime import UTC, datetime
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from pydantic import ValidationError
|
||||
|
||||
from app.modules.tenancy.exceptions import (
|
||||
DNSVerificationException,
|
||||
DomainAlreadyVerifiedException,
|
||||
DomainNotVerifiedException,
|
||||
DomainVerificationFailedException,
|
||||
@@ -29,7 +27,6 @@ from app.modules.tenancy.services.merchant_domain_service import (
|
||||
merchant_domain_service,
|
||||
)
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# ADD DOMAIN TESTS
|
||||
# =============================================================================
|
||||
|
||||
@@ -6,11 +6,9 @@ from datetime import UTC, datetime
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from pydantic import ValidationError
|
||||
|
||||
from app.modules.tenancy.exceptions import (
|
||||
DNSVerificationException,
|
||||
DomainAlreadyVerifiedException,
|
||||
DomainNotVerifiedException,
|
||||
DomainVerificationFailedException,
|
||||
@@ -20,10 +18,12 @@ from app.modules.tenancy.exceptions import (
|
||||
StoreNotFoundException,
|
||||
)
|
||||
from app.modules.tenancy.models import StoreDomain
|
||||
from app.modules.tenancy.schemas.store_domain import StoreDomainCreate, StoreDomainUpdate
|
||||
from app.modules.tenancy.schemas.store_domain import (
|
||||
StoreDomainCreate,
|
||||
StoreDomainUpdate,
|
||||
)
|
||||
from app.modules.tenancy.services.store_domain_service import store_domain_service
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# FIXTURES
|
||||
# =============================================================================
|
||||
|
||||
@@ -12,14 +12,13 @@ import pytest
|
||||
from app.exceptions import ValidationException
|
||||
from app.modules.tenancy.exceptions import (
|
||||
InvalidStoreDataException,
|
||||
UnauthorizedStoreAccessException,
|
||||
StoreAlreadyExistsException,
|
||||
StoreNotFoundException,
|
||||
UnauthorizedStoreAccessException,
|
||||
)
|
||||
from app.modules.tenancy.services.store_service import StoreService
|
||||
from app.modules.tenancy.models import Merchant
|
||||
from app.modules.tenancy.models import Store
|
||||
from app.modules.tenancy.models import Merchant, Store
|
||||
from app.modules.tenancy.schemas.store import StoreCreate
|
||||
from app.modules.tenancy.services.store_service import StoreService
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -3,21 +3,17 @@
|
||||
|
||||
import uuid
|
||||
from datetime import datetime, timedelta
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from app.modules.tenancy.exceptions import (
|
||||
CannotRemoveOwnerException,
|
||||
InvalidInvitationTokenException,
|
||||
TeamInvitationAlreadyAcceptedException,
|
||||
TeamMemberAlreadyExistsException,
|
||||
UserNotFoundException,
|
||||
)
|
||||
from app.modules.tenancy.models import Role, User, Store, StoreUser, StoreUserType
|
||||
from app.modules.tenancy.models import Role, Store, StoreUser, StoreUserType, User
|
||||
from app.modules.tenancy.services.store_team_service import store_team_service
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# FIXTURES
|
||||
# =============================================================================
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import pytest
|
||||
|
||||
from app.modules.tenancy.models import Role, Store, StoreUser
|
||||
from app.modules.tenancy.models import Role, StoreUser
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
|
||||
@@ -10,14 +10,12 @@ Tests cover:
|
||||
- Get store roles
|
||||
"""
|
||||
|
||||
from datetime import UTC, datetime
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from app.exceptions import ValidationException
|
||||
from app.modules.tenancy.services.team_service import TeamService, team_service
|
||||
from app.modules.tenancy.models import Role, StoreUser
|
||||
from app.modules.tenancy.services.team_service import TeamService, team_service
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
|
||||
Reference in New Issue
Block a user