fix(lint): use plain comments for architecture validator codes
Replace # noqa: SVC-006 with # SVC-006 to avoid ruff warnings about unknown codes. Updated architecture validators to match the new format by checking for the code string directly instead of the noqa: prefix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -103,7 +103,7 @@ class MerchantDomain(Base, TimestampMixin):
|
||||
- EXAMPLE.COM -> example.com
|
||||
"""
|
||||
# Remove protocol
|
||||
domain = domain.replace("https://", "").replace("http://", "") # noqa: SEC-034
|
||||
domain = domain.replace("https://", "").replace("http://", "") # SEC-034
|
||||
|
||||
# Remove trailing slash
|
||||
domain = domain.rstrip("/")
|
||||
|
||||
@@ -92,7 +92,7 @@ class StoreDomain(Base, TimestampMixin):
|
||||
- EXAMPLE.COM -> example.com
|
||||
"""
|
||||
# Remove protocol
|
||||
domain = domain.replace("https://", "").replace("http://", "") # noqa: SEC-034
|
||||
domain = domain.replace("https://", "").replace("http://", "") # SEC-034
|
||||
|
||||
# Remove trailing slash
|
||||
domain = domain.rstrip("/")
|
||||
|
||||
@@ -100,7 +100,7 @@ def _build_module_response(
|
||||
is_enabled: bool,
|
||||
) -> ModuleResponse:
|
||||
"""Build ModuleResponse from module code."""
|
||||
from app.modules.enums import FrontendType # noqa: API-007 - Enum for type safety
|
||||
from app.modules.enums import FrontendType # API-007 - Enum for type safety
|
||||
|
||||
module = MODULES.get(code)
|
||||
if not module:
|
||||
|
||||
@@ -22,7 +22,7 @@ from app.api.deps import get_current_super_admin, get_current_super_admin_api
|
||||
from app.core.database import get_db
|
||||
from app.exceptions import ValidationException
|
||||
from app.modules.tenancy.models import (
|
||||
User, # noqa: API-007 - Internal helper uses User model
|
||||
User, # API-007 - Internal helper uses User model
|
||||
)
|
||||
from app.modules.tenancy.services.admin_platform_service import admin_platform_service
|
||||
from models.schema.auth import UserContext
|
||||
|
||||
@@ -18,7 +18,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from app.core.database import get_db
|
||||
from app.modules.tenancy.schemas.store import StoreDetailResponse
|
||||
from app.modules.tenancy.services.store_service import store_service # noqa: mod-004
|
||||
from app.modules.tenancy.services.store_service import store_service # mod-004
|
||||
|
||||
store_router = APIRouter()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -34,7 +34,7 @@ class MerchantDomainCreate(BaseModel):
|
||||
def validate_domain(cls, v: str) -> str:
|
||||
"""Validate and normalize domain."""
|
||||
# Remove protocol if present
|
||||
domain = v.replace("https://", "").replace("http://", "") # noqa: SEC-034
|
||||
domain = v.replace("https://", "").replace("http://", "") # SEC-034
|
||||
|
||||
# Remove trailing slash
|
||||
domain = domain.rstrip("/")
|
||||
|
||||
@@ -35,7 +35,7 @@ class StoreDomainCreate(BaseModel):
|
||||
def validate_domain(cls, v: str) -> str:
|
||||
"""Validate and normalize domain."""
|
||||
# Remove protocol if present
|
||||
domain = v.replace("https://", "").replace("http://", "") # noqa: SEC-034
|
||||
domain = v.replace("https://", "").replace("http://", "") # SEC-034
|
||||
|
||||
# Remove trailing slash
|
||||
domain = domain.rstrip("/")
|
||||
|
||||
Reference in New Issue
Block a user