From 26678b164b40596f6848685f972c5d7321af9e03 Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 23 Apr 2026 20:22:56 -0400 Subject: [PATCH] style: fix ruff formatting in bracket_view and routes Co-Authored-By: Claude Opus 4.6 --- app/bracket_view.py | 21 ++++++++++++++++++--- app/routes.py | 17 ++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/app/bracket_view.py b/app/bracket_view.py index 09410bf..da42a08 100644 --- a/app/bracket_view.py +++ b/app/bracket_view.py @@ -67,9 +67,24 @@ def build_bracket_view(year, bracket_payload, fetched_at=None): "west_cf": west_cf, "cup": cup, "rounds": [ - {"label": ROUND_LABELS[1], "round_num": 1, "east": east_r1, "west": west_r1}, - {"label": ROUND_LABELS[2], "round_num": 2, "east": east_r2, "west": west_r2}, - {"label": ROUND_LABELS[3], "round_num": 3, "east": east_cf, "west": west_cf}, + { + "label": ROUND_LABELS[1], + "round_num": 1, + "east": east_r1, + "west": west_r1, + }, + { + "label": ROUND_LABELS[2], + "round_num": 2, + "east": east_r2, + "west": west_r2, + }, + { + "label": ROUND_LABELS[3], + "round_num": 3, + "east": east_cf, + "west": west_cf, + }, {"label": ROUND_LABELS[4], "round_num": 4, "cup": cup}, ], } diff --git a/app/routes.py b/app/routes.py index c01d791..ee0b431 100644 --- a/app/routes.py +++ b/app/routes.py @@ -2,7 +2,14 @@ import json import logging import requests as http_requests -from flask import abort, make_response, render_template, jsonify, request, send_from_directory +from flask import ( + abort, + make_response, + render_template, + jsonify, + request, + send_from_directory, +) from app import APP_VERSION, app, static_v from app.config import SCOREBOARD_DATA_FILE @@ -93,13 +100,17 @@ def get_scoreboard(): return jsonify({"error": "Invalid date format. Use YYYY-MM-DD."}), 400 scoreboard_data = _fetch_date(date_param) if not scoreboard_data: - return jsonify({"error": "Failed to retrieve scoreboard data for that date."}) + return jsonify( + {"error": "Failed to retrieve scoreboard data for that date."} + ) else: try: with open(SCOREBOARD_DATA_FILE, "r") as json_file: scoreboard_data = json.load(json_file) except FileNotFoundError: - return jsonify({"error": "Failed to retrieve scoreboard data. File not found."}) + return jsonify( + {"error": "Failed to retrieve scoreboard data. File not found."} + ) except json.JSONDecodeError: return jsonify( {"error": "Failed to retrieve scoreboard data. Invalid JSON format."}