Skip to content

Commit cee72e8

Browse files
fray-cloudclaude
andcommitted
fix: fix all Python import ordering (ruff I001)
Auto-fix import sorting across all services. Resolves CI python-lint failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6843ca4 commit cee72e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+130
-130
lines changed

services/auth/src/auth/application/command_handlers.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
import secrets
33
from uuid import UUID
44

5+
from shared.cqrs.command import Command, CommandHandler
6+
from shared.domain.exceptions import (
7+
AuthorizationError,
8+
BusinessRuleViolationError,
9+
ConflictError,
10+
EntityNotFoundError,
11+
)
12+
from shared.messaging.producer import KafkaEventProducer
13+
514
from auth.application.dto import APITokenDTO, AuthTokenDTO
615
from auth.domain.api_token import APIToken
716
from auth.domain.permission import Permission
@@ -11,14 +20,6 @@
1120
from auth.infrastructure.login_rate_limiter import LoginRateLimiter
1221
from auth.infrastructure.security import BcryptPasswordService, JWTService
1322
from auth.infrastructure.token_blacklist import RedisTokenBlacklist
14-
from shared.cqrs.command import Command, CommandHandler
15-
from shared.domain.exceptions import (
16-
AuthorizationError,
17-
BusinessRuleViolationError,
18-
ConflictError,
19-
EntityNotFoundError,
20-
)
21-
from shared.messaging.producer import KafkaEventProducer
2223

2324

2425
class RegisterUserHandler(CommandHandler[UUID]):

services/auth/src/auth/application/query_handlers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from shared.cqrs.query import Query, QueryHandler
2+
from shared.domain.exceptions import AuthorizationError, EntityNotFoundError
3+
14
from auth.application.dto import (
25
APITokenDTO,
36
PermissionCheckDTO,
@@ -13,8 +16,6 @@
1316
from auth.domain.services import PermissionChecker
1417
from auth.infrastructure.security import JWTService
1518
from auth.infrastructure.token_blacklist import RedisTokenBlacklist
16-
from shared.cqrs.query import Query, QueryHandler
17-
from shared.domain.exceptions import AuthorizationError, EntityNotFoundError
1819

1920

2021
class GetUserHandler(QueryHandler[UserDTO]):

services/auth/src/auth/domain/api_token.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from uuid import UUID
44

55
from pydantic import Field
6-
7-
from auth.domain.events import TokenGenerated, TokenRevoked
86
from shared.domain.entity import Entity
97
from shared.domain.exceptions import BusinessRuleViolationError
108
from shared.event.domain_event import DomainEvent
119

10+
from auth.domain.events import TokenGenerated, TokenRevoked
11+
1212

1313
class APIToken(Entity):
1414
user_id: UUID

services/auth/src/auth/domain/group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from uuid import UUID
33

44
from pydantic import Field
5-
65
from shared.domain.entity import Entity
76
from shared.event.domain_event import DomainEvent
87

services/auth/src/auth/domain/repository.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from abc import abstractmethod
22
from uuid import UUID
33

4+
from shared.domain.repository import Repository
5+
46
from auth.domain.api_token import APIToken
57
from auth.domain.group import Group
68
from auth.domain.role import Role
79
from auth.domain.user import User
8-
from shared.domain.repository import Repository
910

1011

1112
class UserRepository(Repository[User]):

services/auth/src/auth/domain/role.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from uuid import UUID
44

55
from pydantic import Field
6-
7-
from auth.domain.permission import Permission
86
from shared.domain.entity import Entity
97
from shared.domain.exceptions import BusinessRuleViolationError
108
from shared.event.domain_event import DomainEvent
119

10+
from auth.domain.permission import Permission
11+
1212

1313
class Role(Entity):
1414
name: str

services/auth/src/auth/domain/user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
from uuid import UUID
55

66
from pydantic import Field
7-
8-
from auth.domain.events import RoleAssigned, RoleRemoved, UserCreated, UserLocked
97
from shared.domain.entity import Entity
108
from shared.domain.exceptions import BusinessRuleViolationError
119
from shared.event.domain_event import DomainEvent
1210

11+
from auth.domain.events import RoleAssigned, RoleRemoved, UserCreated, UserLocked
12+
1313

1414
class UserStatus(StrEnum):
1515
ACTIVE = "active"

services/auth/src/auth/interface/dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from uuid import UUID
22

33
from fastapi import Request
4+
from shared.domain.exceptions import AuthorizationError
45

56
from auth.infrastructure.security import JWTService
6-
from shared.domain.exceptions import AuthorizationError
77

88

99
async def get_current_user(request: Request) -> dict:

services/auth/src/auth/interface/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
from fastapi import FastAPI
55
from fastapi.middleware.cors import CORSMiddleware
6+
from shared.api.errors import domain_exception_handler
7+
from shared.api.middleware import CorrelationIdMiddleware
8+
from shared.domain.exceptions import DomainError
9+
from shared.messaging.producer import KafkaEventProducer
10+
from shared.messaging.serialization import EventSerializer
611

712
from auth.domain.events import (
813
RoleAssigned,
@@ -24,11 +29,6 @@
2429
role_router,
2530
user_router,
2631
)
27-
from shared.api.errors import domain_exception_handler
28-
from shared.api.middleware import CorrelationIdMiddleware
29-
from shared.domain.exceptions import DomainError
30-
from shared.messaging.producer import KafkaEventProducer
31-
from shared.messaging.serialization import EventSerializer
3232

3333

3434
@asynccontextmanager

services/auth/src/auth/interface/router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from uuid import UUID
22

33
from fastapi import APIRouter, Depends, Request, status
4+
from shared.api.pagination import OffsetParams
5+
from shared.cqrs.bus import CommandBus, QueryBus
46
from sqlalchemy.ext.asyncio import AsyncSession
57

68
from auth.application.command_handlers import (
@@ -69,8 +71,6 @@
6971
UserListResponse,
7072
UserResponse,
7173
)
72-
from shared.api.pagination import OffsetParams
73-
from shared.cqrs.bus import CommandBus, QueryBus
7474

7575
# --- Helpers ---
7676

0 commit comments

Comments
 (0)