Compare commits

..
3 Commits
Author SHA1 Message Date
LeoVasanko f483cf978c Ruff format 2026-02-10 20:56:06 +00:00
LeoVasanko 0e12e3a531 Improved error message. 2026-02-10 19:51:05 +00:00
LeoVasanko 67bea9a2a7 Remove unnecessary bool() 2026-02-10 19:46:32 +00:00
4 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -276,6 +276,6 @@ def _devmode_respond(request: Request, name=""):
return JSONResponse( return JSONResponse(
status_code=409, status_code=409,
content={ content={
"detail": "Frontend assets served by Vite in debug mode. You are on backend, connect to frontend instead." "detail": "[devmode] Not serving frontend files here. Should you connect to Vite instead?"
}, },
) )
+12 -1
View File
@@ -50,7 +50,18 @@ def ruff_format_content(content: str, target_path: Path) -> str:
temp_file.write_text(content, "UTF-8", newline="\n") temp_file.write_text(content, "UTF-8", newline="\n")
# Sort imports first # Sort imports first
subprocess.run( subprocess.run(
["uv", "run", "--with", "ruff", "ruff", "check", "--select", "I", "--fix", str(temp_file)], [
"uv",
"run",
"--with",
"ruff",
"ruff",
"check",
"--select",
"I",
"--fix",
str(temp_file),
],
cwd=target_path.parent, cwd=target_path.parent,
capture_output=True, capture_output=True,
) )
+1 -1
View File
@@ -5,7 +5,7 @@ import os
from fastapi_vue import server from fastapi_vue import server
DEFAULT_PORT = TEMPLATE_DEFAULT_PORT DEFAULT_PORT = TEMPLATE_DEFAULT_PORT
DEVMODE = bool(os.getenv("ENVPREFIX_DEV") == "1") DEVMODE = os.getenv("ENVPREFIX_DEV") == "1"
def main(): def main():
+2 -1
View File
@@ -56,7 +56,8 @@ def main():
epilog=HELP_EPILOG, epilog=HELP_EPILOG,
) )
parser.add_argument( parser.add_argument(
"-l", "--listen", "-l",
"--listen",
metavar="host:port", metavar="host:port",
help=f"Vite (default: localhost:{DEFAULT_VITE_PORT})", help=f"Vite (default: localhost:{DEFAULT_VITE_PORT})",
) )