chore(lint): apply ruff --fix (4443 auto-fixes)

Auto-fixed categories:
- F401: unused imports removed
- I001: import blocks sorted
- W293: trailing whitespace stripped
- UP035: deprecated typing imports replaced
- SIM: simplify suggestions applied
- ARG: unused args prefixed with underscore
- T201: print statements removed
- F841: unused variables removed
- RUF059: unpacked variables prefixed

Remaining ~1500 unfixable errors (C901, B904, N806, E402) require manual work.

Backend smoke tests: 13/13 passed.
This commit is contained in:
2026-05-14 11:20:17 +03:00
parent a9a5eff518
commit c6189876b3
337 changed files with 4677 additions and 4515 deletions

View File

@@ -1,7 +1,11 @@
from abc import ABC, abstractmethod
from typing import Dict, Any, Optional
from .logger import belief_scope
from typing import Any
from pydantic import BaseModel, Field
from .logger import belief_scope
# #region PluginBase [TYPE Class] [SEMANTICS plugin, interface, base, abstract]
# @BRIEF Defines the abstract base class that all plugins must implement to be recognized by the system. It enforces a common structure for plugin metadata and execution.
# @LAYER: Core
@@ -77,7 +81,7 @@ class PluginBase(ABC):
# @PRE: Plugin instance exists.
# @POST: Returns string route or None.
# @RETURN: Optional[str] - Frontend route.
def ui_route(self) -> Optional[str]:
def ui_route(self) -> str | None:
"""
The frontend route for the plugin's UI.
Returns None if the plugin does not have a dedicated UI page.
@@ -91,7 +95,7 @@ class PluginBase(ABC):
# @PRE: Plugin instance exists.
# @POST: Returns dict schema.
# @RETURN: Dict[str, Any] - JSON schema.
def get_schema(self) -> Dict[str, Any]:
def get_schema(self) -> dict[str, Any]:
"""
Returns the JSON schema for the plugin's input parameters.
This schema will be used to generate the frontend form.
@@ -105,7 +109,7 @@ class PluginBase(ABC):
# @PARAM: params (Dict[str, Any]) - Validated input parameters.
# @PRE: params must be a dictionary.
# @POST: Plugin execution is completed.
async def execute(self, params: Dict[str, Any]):
async def execute(self, params: dict[str, Any]):
with belief_scope("execute"):
pass
"""
@@ -125,6 +129,6 @@ class PluginConfig(BaseModel):
name: str = Field(..., description="Human-readable name for the plugin")
description: str = Field(..., description="Brief description of what the plugin does")
version: str = Field(..., description="Version of the plugin")
ui_route: Optional[str] = Field(None, description="Frontend route for the plugin UI")
input_schema: Dict[str, Any] = Field(..., description="JSON schema for input parameters", alias="schema")
# #endregion PluginConfig
ui_route: str | None = Field(None, description="Frontend route for the plugin UI")
input_schema: dict[str, Any] = Field(..., description="JSON schema for input parameters", alias="schema")
# #endregion PluginConfig