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:
@@ -5,9 +5,10 @@ Error Page Renderer
|
||||
Renders context-aware error pages using Jinja2 templates.
|
||||
Handles fallback logic and context-specific customization.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any
|
||||
|
||||
from fastapi import Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
@@ -60,7 +61,7 @@ class ErrorPageRenderer:
|
||||
status_code: int,
|
||||
error_code: str,
|
||||
message: str,
|
||||
details: Optional[Dict[str, Any]] = None,
|
||||
details: dict[str, Any] | None = None,
|
||||
show_debug: bool = False,
|
||||
) -> HTMLResponse:
|
||||
"""
|
||||
@@ -190,9 +191,9 @@ class ErrorPageRenderer:
|
||||
status_code: int,
|
||||
error_code: str,
|
||||
message: str,
|
||||
details: Optional[Dict[str, Any]],
|
||||
details: dict[str, Any] | None,
|
||||
show_debug: bool,
|
||||
) -> Dict[str, Any]:
|
||||
) -> dict[str, Any]:
|
||||
"""Prepare data dictionary for error template."""
|
||||
# Get friendly status name
|
||||
status_name = ErrorPageRenderer.STATUS_CODE_NAMES.get(
|
||||
@@ -229,7 +230,7 @@ class ErrorPageRenderer:
|
||||
@staticmethod
|
||||
def _get_context_data(
|
||||
request: Request, context_type: RequestContext
|
||||
) -> Dict[str, Any]:
|
||||
) -> dict[str, Any]:
|
||||
"""Get context-specific data for error templates."""
|
||||
data = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user