From c484c9ecc8d3cd7bb7907a38b8631681ab2b0114 Mon Sep 17 00:00:00 2001 From: Username Date: Mon, 16 Feb 2026 22:02:36 +0100 Subject: [PATCH] routes: fix ruff formatting --- app/api/routes.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/app/api/routes.py b/app/api/routes.py index 0706280..2a1f302 100644 --- a/app/api/routes.py +++ b/app/api/routes.py @@ -575,15 +575,11 @@ def validate_target_url(url: str) -> Response | None: """Validate target URL for shortening. Returns error response or None if valid.""" max_length = current_app.config["SHORT_URL_MAX_LENGTH"] if len(url) > max_length: - return error_response( - "URL too long", 400, max_length=max_length, length=len(url) - ) + return error_response("URL too long", 400, max_length=max_length, length=len(url)) parsed = urlparse(url) if parsed.scheme not in ALLOWED_URL_SCHEMES: - return error_response( - "Invalid URL scheme", 400, allowed=list(ALLOWED_URL_SCHEMES) - ) + return error_response("Invalid URL scheme", 400, allowed=list(ALLOWED_URL_SCHEMES)) if not parsed.netloc: return error_response("Invalid URL: missing host", 400) @@ -2233,13 +2229,15 @@ class ShortURLsListView(MethodView): entry["expires_at"] = row["expires_at"] urls.append(entry) - return json_response({ - "urls": urls, - "count": len(urls), - "total": total, - "limit": limit, - "offset": offset, - }) + return json_response( + { + "urls": urls, + "count": len(urls), + "total": total, + "limit": limit, + "offset": offset, + } + ) # ─────────────────────────────────────────────────────────────────────────────