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:
@@ -13,7 +13,6 @@ Note: Environment detection is handled by app.core.environment module.
|
||||
This module focuses purely on configuration storage and validation.
|
||||
"""
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
@@ -82,7 +81,7 @@ class Settings(BaseSettings):
|
||||
# =============================================================================
|
||||
# MIDDLEWARE & SECURITY
|
||||
# =============================================================================
|
||||
allowed_hosts: List[str] = ["*"] # Configure for production
|
||||
allowed_hosts: list[str] = ["*"] # Configure for production
|
||||
|
||||
# Rate Limiting
|
||||
rate_limit_enabled: bool = True
|
||||
@@ -93,7 +92,7 @@ class Settings(BaseSettings):
|
||||
# LOGGING
|
||||
# =============================================================================
|
||||
log_level: str = "INFO"
|
||||
log_file: Optional[str] = None
|
||||
log_file: str | None = None
|
||||
|
||||
# =============================================================================
|
||||
# PLATFORM DOMAIN CONFIGURATION
|
||||
@@ -138,9 +137,13 @@ settings = Settings()
|
||||
# ENVIRONMENT UTILITIES - Module-level functions
|
||||
# =============================================================================
|
||||
# Import environment detection utilities
|
||||
from app.core.environment import (get_environment, is_development,
|
||||
is_production, is_staging,
|
||||
should_use_secure_cookies)
|
||||
from app.core.environment import (
|
||||
get_environment,
|
||||
is_development,
|
||||
is_production,
|
||||
is_staging,
|
||||
should_use_secure_cookies,
|
||||
)
|
||||
|
||||
|
||||
def get_current_environment() -> str:
|
||||
@@ -188,7 +191,7 @@ def is_staging_environment() -> bool:
|
||||
# =============================================================================
|
||||
|
||||
|
||||
def validate_production_settings() -> List[str]:
|
||||
def validate_production_settings() -> list[str]:
|
||||
"""
|
||||
Validate settings for production environment.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user