treewide: reformat

This commit is contained in:
Michael Hoang
2025-10-13 17:36:50 +02:00
parent 9b71f106f6
commit cbcfcd507d
26 changed files with 66 additions and 68 deletions

View File

@@ -41,7 +41,7 @@ class ApiBridge(Protocol):
def process_request(self, request: BackendRequest) -> None:
"""Process an API request through the middleware chain."""
from clan_app.middleware.base import MiddlewareContext # noqa: PLC0415
from clan_app.middleware.base import MiddlewareContext
with ExitStack() as stack:
# Capture the current call stack up to this point
@@ -62,7 +62,7 @@ class ApiBridge(Protocol):
)
middleware.process(context)
except Exception as e:
from clan_app.middleware.base import ( # noqa: PLC0415
from clan_app.middleware.base import (
MiddlewareError,
)

View File

@@ -191,13 +191,13 @@ class HttpBridge(ApiBridge, BaseHTTPRequestHandler):
return file_data
def do_OPTIONS(self) -> None:
def do_OPTIONS(self) -> None: # noqa: N802
"""Handle CORS preflight requests."""
self.send_response_only(200)
self._send_cors_headers()
self.end_headers()
def do_GET(self) -> None:
def do_GET(self) -> None: # noqa: N802
"""Handle GET requests."""
parsed_url = urlparse(self.path)
path = parsed_url.path
@@ -211,7 +211,7 @@ class HttpBridge(ApiBridge, BaseHTTPRequestHandler):
else:
self.send_api_error_response("info", "Not Found", ["http_bridge", "GET"])
def do_POST(self) -> None:
def do_POST(self) -> None: # noqa: N802
"""Handle POST requests."""
parsed_url = urlparse(self.path)
path = parsed_url.path

View File

@@ -34,7 +34,7 @@ class WebviewBridge(ApiBridge):
log.debug(f"Sending response: {serialized}")
# Import FuncStatus locally to avoid circular import
from .webview import FuncStatus # noqa: PLC0415
from .webview import FuncStatus
self.webview.return_(response._op_key, FuncStatus.SUCCESS, serialized) # noqa: SLF001