refactor: modernize code quality tooling with Ruff
- Replace black, isort, and flake8 with Ruff (all-in-one linter and formatter) - Add comprehensive pyproject.toml configuration - Simplify Makefile code quality targets - Configure exclusions for venv/.venv in pyproject.toml - Auto-fix 1,359 linting issues across codebase Benefits: - Much faster builds (Ruff is written in Rust) - Single tool replaces multiple tools - More comprehensive rule set (UP, B, C4, SIM, PIE, RET, Q) - All configuration centralized in pyproject.toml - Better import sorting and formatting consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
Pydantic schemas for shopping cart operations.
|
||||
"""
|
||||
|
||||
from datetime import datetime
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
@@ -43,7 +41,7 @@ class CartItemResponse(BaseModel):
|
||||
line_total: float = Field(
|
||||
..., description="Total price for this line (price * quantity)"
|
||||
)
|
||||
image_url: Optional[str] = Field(None, description="Product image URL")
|
||||
image_url: str | None = Field(None, description="Product image URL")
|
||||
|
||||
|
||||
class CartResponse(BaseModel):
|
||||
@@ -51,7 +49,7 @@ class CartResponse(BaseModel):
|
||||
|
||||
vendor_id: int = Field(..., description="Vendor ID")
|
||||
session_id: str = Field(..., description="Shopping session ID")
|
||||
items: List[CartItemResponse] = Field(
|
||||
items: list[CartItemResponse] = Field(
|
||||
default_factory=list, description="Cart items"
|
||||
)
|
||||
subtotal: float = Field(..., description="Subtotal of all items")
|
||||
@@ -82,7 +80,7 @@ class CartOperationResponse(BaseModel):
|
||||
|
||||
message: str = Field(..., description="Operation result message")
|
||||
product_id: int = Field(..., description="Product ID affected")
|
||||
quantity: Optional[int] = Field(
|
||||
quantity: int | None = Field(
|
||||
None, description="New quantity (for add/update operations)"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user