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,7 +3,6 @@
|
||||
Pydantic schemas for vendor theme operations.
|
||||
"""
|
||||
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
@@ -11,40 +10,40 @@ from pydantic import BaseModel, Field
|
||||
class VendorThemeColors(BaseModel):
|
||||
"""Color scheme for vendor theme."""
|
||||
|
||||
primary: Optional[str] = Field(None, description="Primary brand color")
|
||||
secondary: Optional[str] = Field(None, description="Secondary color")
|
||||
accent: Optional[str] = Field(None, description="Accent/CTA color")
|
||||
background: Optional[str] = Field(None, description="Background color")
|
||||
text: Optional[str] = Field(None, description="Text color")
|
||||
border: Optional[str] = Field(None, description="Border color")
|
||||
primary: str | None = Field(None, description="Primary brand color")
|
||||
secondary: str | None = Field(None, description="Secondary color")
|
||||
accent: str | None = Field(None, description="Accent/CTA color")
|
||||
background: str | None = Field(None, description="Background color")
|
||||
text: str | None = Field(None, description="Text color")
|
||||
border: str | None = Field(None, description="Border color")
|
||||
|
||||
|
||||
class VendorThemeFonts(BaseModel):
|
||||
"""Typography settings for vendor theme."""
|
||||
|
||||
heading: Optional[str] = Field(None, description="Font for headings")
|
||||
body: Optional[str] = Field(None, description="Font for body text")
|
||||
heading: str | None = Field(None, description="Font for headings")
|
||||
body: str | None = Field(None, description="Font for body text")
|
||||
|
||||
|
||||
class VendorThemeBranding(BaseModel):
|
||||
"""Branding assets for vendor theme."""
|
||||
|
||||
logo: Optional[str] = Field(None, description="Logo URL")
|
||||
logo_dark: Optional[str] = Field(None, description="Dark mode logo URL")
|
||||
favicon: Optional[str] = Field(None, description="Favicon URL")
|
||||
banner: Optional[str] = Field(None, description="Banner image URL")
|
||||
logo: str | None = Field(None, description="Logo URL")
|
||||
logo_dark: str | None = Field(None, description="Dark mode logo URL")
|
||||
favicon: str | None = Field(None, description="Favicon URL")
|
||||
banner: str | None = Field(None, description="Banner image URL")
|
||||
|
||||
|
||||
class VendorThemeLayout(BaseModel):
|
||||
"""Layout settings for vendor theme."""
|
||||
|
||||
style: Optional[str] = Field(
|
||||
style: str | None = Field(
|
||||
None, description="Product layout style (grid, list, masonry)"
|
||||
)
|
||||
header: Optional[str] = Field(
|
||||
header: str | None = Field(
|
||||
None, description="Header style (fixed, static, transparent)"
|
||||
)
|
||||
product_card: Optional[str] = Field(
|
||||
product_card: str | None = Field(
|
||||
None, description="Product card style (modern, classic, minimal)"
|
||||
)
|
||||
|
||||
@@ -52,15 +51,15 @@ class VendorThemeLayout(BaseModel):
|
||||
class VendorThemeUpdate(BaseModel):
|
||||
"""Schema for updating vendor theme (partial updates allowed)."""
|
||||
|
||||
theme_name: Optional[str] = Field(None, description="Theme preset name")
|
||||
colors: Optional[Dict[str, str]] = Field(None, description="Color scheme")
|
||||
fonts: Optional[Dict[str, str]] = Field(None, description="Font settings")
|
||||
branding: Optional[Dict[str, Optional[str]]] = Field(
|
||||
theme_name: str | None = Field(None, description="Theme preset name")
|
||||
colors: dict[str, str] | None = Field(None, description="Color scheme")
|
||||
fonts: dict[str, str] | None = Field(None, description="Font settings")
|
||||
branding: dict[str, str | None] | None = Field(
|
||||
None, description="Branding assets"
|
||||
)
|
||||
layout: Optional[Dict[str, str]] = Field(None, description="Layout settings")
|
||||
custom_css: Optional[str] = Field(None, description="Custom CSS rules")
|
||||
social_links: Optional[Dict[str, str]] = Field(
|
||||
layout: dict[str, str] | None = Field(None, description="Layout settings")
|
||||
custom_css: str | None = Field(None, description="Custom CSS rules")
|
||||
social_links: dict[str, str] | None = Field(
|
||||
None, description="Social media links"
|
||||
)
|
||||
|
||||
@@ -69,15 +68,15 @@ class VendorThemeResponse(BaseModel):
|
||||
"""Schema for vendor theme response."""
|
||||
|
||||
theme_name: str = Field(..., description="Theme name")
|
||||
colors: Dict[str, str] = Field(..., description="Color scheme")
|
||||
fonts: Dict[str, str] = Field(..., description="Font settings")
|
||||
branding: Dict[str, Optional[str]] = Field(..., description="Branding assets")
|
||||
layout: Dict[str, str] = Field(..., description="Layout settings")
|
||||
social_links: Optional[Dict[str, str]] = Field(
|
||||
colors: dict[str, str] = Field(..., description="Color scheme")
|
||||
fonts: dict[str, str] = Field(..., description="Font settings")
|
||||
branding: dict[str, str | None] = Field(..., description="Branding assets")
|
||||
layout: dict[str, str] = Field(..., description="Layout settings")
|
||||
social_links: dict[str, str] | None = Field(
|
||||
default_factory=dict, description="Social links"
|
||||
)
|
||||
custom_css: Optional[str] = Field(None, description="Custom CSS")
|
||||
css_variables: Optional[Dict[str, str]] = Field(
|
||||
custom_css: str | None = Field(None, description="Custom CSS")
|
||||
css_variables: dict[str, str] | None = Field(
|
||||
None, description="CSS custom properties"
|
||||
)
|
||||
|
||||
@@ -105,4 +104,4 @@ class ThemePresetResponse(BaseModel):
|
||||
class ThemePresetListResponse(BaseModel):
|
||||
"""List of available theme presets."""
|
||||
|
||||
presets: List[ThemePresetPreview] = Field(..., description="Available presets")
|
||||
presets: list[ThemePresetPreview] = Field(..., description="Available presets")
|
||||
|
||||
Reference in New Issue
Block a user