Cleanup for ALL ruff checks, and re-ruff to target project settings when installing templates, avoiding formatting errors after patching.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Backend package with FastAPI application and Vue frontend integration."""
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# auto-upgrade@fastapi-vue-setup - remove this if you modify this file
|
||||
"""Command-line entry point for running the backend server."""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
|
||||
@@ -8,7 +10,8 @@ DEFAULT_PORT = TEMPLATE_DEFAULT_PORT
|
||||
DEVMODE = os.getenv("ENVPREFIX_DEV") == "1"
|
||||
|
||||
|
||||
def main():
|
||||
def main() -> None:
|
||||
"""Run the backend server with optional arguments."""
|
||||
parser = argparse.ArgumentParser(description="Run the MODULE_NAME server.")
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
"""FastAPI application module with Vue frontend integration."""
|
||||
|
||||
from collections.abc import AsyncIterator
|
||||
from contextlib import asynccontextmanager
|
||||
from pathlib import Path
|
||||
|
||||
@@ -10,7 +13,7 @@ frontend = Frontend(Path(__file__).with_name("frontend-build"))
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
async def lifespan(_app: FastAPI) -> AsyncIterator[None]:
|
||||
"""Manage app startup and shutdown resources."""
|
||||
await frontend.load()
|
||||
yield
|
||||
@@ -24,7 +27,8 @@ app = FastAPI(title="PROJECT_TITLE", debug=DEVMODE, lifespan=lifespan)
|
||||
|
||||
# Health check endpoint for the Vue demo app to verify the backend is running
|
||||
@app.get("/api/health")
|
||||
async def health_check():
|
||||
async def health_check() -> dict[str, str]:
|
||||
"""Return backend status for health monitoring."""
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user