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:
@@ -25,8 +25,8 @@ class MarketplaceImportJobRequest(BaseModel):
|
||||
@field_validator("source_url")
|
||||
@classmethod
|
||||
def validate_url(cls, v):
|
||||
if not v.startswith(("http://", "https://")): # noqa: SEC-034
|
||||
raise ValueError("URL must start with http:// or https://") # noqa: SEC-034
|
||||
if not v.startswith(("http://", "https://")): # SEC-034
|
||||
raise ValueError("URL must start with http:// or https://") # SEC-034
|
||||
return v.strip()
|
||||
|
||||
@field_validator("marketplace")
|
||||
@@ -64,8 +64,8 @@ class AdminMarketplaceImportJobRequest(BaseModel):
|
||||
@field_validator("source_url")
|
||||
@classmethod
|
||||
def validate_url(cls, v):
|
||||
if not v.startswith(("http://", "https://")): # noqa: SEC-034
|
||||
raise ValueError("URL must start with http:// or https://") # noqa: SEC-034
|
||||
if not v.startswith(("http://", "https://")): # SEC-034
|
||||
raise ValueError("URL must start with http:// or https://") # SEC-034
|
||||
return v.strip()
|
||||
|
||||
@field_validator("marketplace")
|
||||
|
||||
@@ -865,7 +865,7 @@ class LetzshopOrderService:
|
||||
pass
|
||||
|
||||
if needs_update:
|
||||
self.db.commit() # noqa: SVC-006 - background task needs incremental commits
|
||||
self.db.commit() # SVC-006 - background task needs incremental commits
|
||||
stats["updated"] += 1
|
||||
else:
|
||||
stats["skipped"] += 1
|
||||
@@ -881,7 +881,7 @@ class LetzshopOrderService:
|
||||
# Create new order using unified service
|
||||
try:
|
||||
self.create_order(store_id, shipment)
|
||||
self.db.commit() # noqa: SVC-006 - background task needs incremental commits
|
||||
self.db.commit() # SVC-006 - background task needs incremental commits
|
||||
stats["imported"] += 1
|
||||
|
||||
# Decrement remaining count for batch efficiency
|
||||
@@ -1093,7 +1093,7 @@ class LetzshopOrderService:
|
||||
status="pending",
|
||||
)
|
||||
self.db.add(job)
|
||||
self.db.commit() # noqa: SVC-006 - job must be visible immediately before background task starts
|
||||
self.db.commit() # SVC-006 - job must be visible immediately before background task starts
|
||||
self.db.refresh(job)
|
||||
return job
|
||||
|
||||
@@ -1134,6 +1134,6 @@ class LetzshopOrderService:
|
||||
)
|
||||
if job:
|
||||
job.celery_task_id = celery_task_id
|
||||
self.db.commit() # noqa: SVC-006 - Called from API endpoint
|
||||
self.db.commit() # SVC-006 - Called from API endpoint
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -498,7 +498,7 @@ class LetzshopStoreSyncService:
|
||||
# Create store
|
||||
store = admin_service.create_store(self.db, store_data)
|
||||
|
||||
# Mark the Letzshop store as claimed (commits internally) # noqa: SVC-006
|
||||
# Mark the Letzshop store as claimed (commits internally) # SVC-006
|
||||
self.mark_store_claimed(letzshop_slug, store.id)
|
||||
|
||||
logger.info(
|
||||
|
||||
@@ -446,7 +446,7 @@ class MarketplaceProductService:
|
||||
InventorySummaryResponse if inventory found, None otherwise
|
||||
"""
|
||||
try:
|
||||
# noqa: SVC-005 - Admin/internal function for inventory lookup by GTIN
|
||||
# SVC-005 - Admin/internal function for inventory lookup by GTIN
|
||||
inventory_entries = db.query(Inventory).filter(Inventory.gtin == gtin).all()
|
||||
if not inventory_entries:
|
||||
return None
|
||||
|
||||
@@ -415,7 +415,7 @@ class PlatformSignupService:
|
||||
)
|
||||
subscription.stripe_customer_id = stripe_customer_id
|
||||
|
||||
db.commit() # noqa: SVC-006 - Atomic account creation needs commit
|
||||
db.commit() # SVC-006 - Atomic account creation needs commit
|
||||
|
||||
# Update session
|
||||
self.update_session(session_id, {
|
||||
@@ -603,7 +603,7 @@ class PlatformSignupService:
|
||||
if subscription:
|
||||
subscription.card_collected_at = datetime.now(UTC)
|
||||
subscription.stripe_payment_method_id = payment_method_id
|
||||
db.commit() # noqa: SVC-006 - Finalize signup needs commit
|
||||
db.commit() # SVC-006 - Finalize signup needs commit
|
||||
|
||||
# Get store info
|
||||
store = db.query(Store).filter(Store.id == store_id).first()
|
||||
|
||||
Reference in New Issue
Block a user