diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 13c8491..01ce2d8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: key: ruff-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/ruff.toml') }} - name: Install Ruff - run: pip install "ruff==0.6.9" + run: pip install "ruff==0.13.3" # Lint (with GitHub annotation format for inline PR messages) - name: Ruff check diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0dd031f..fef2f29 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 # pin the latest you’re comfortable with + rev: v0.13.3 # pin the latest you’re comfortable with hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] # fail if it had to change files diff --git a/meshview/web.py b/meshview/web.py index bf704af..e0e2ab2 100644 --- a/meshview/web.py +++ b/meshview/web.py @@ -1335,7 +1335,7 @@ async def nodegraph(request): edge_pair = (node.node_id, packet.from_node_id) edges_map[edge_pair]["weight"] += 1 - edges_map[edge_pair]["type"] = ("neighbor") + edges_map[edge_pair]["type"] = "neighbor" except Exception as e: logger.error(f"Error decoding NeighborInfo packet: {e}") @@ -1691,6 +1691,7 @@ async def api_edges(request): f"Error decoding NeighborInfo packet {getattr(packet, 'id', '?')}: {e}" ) + @routes.get("/api/lang") async def api_lang(request): # Language from ?lang=xx, fallback to config, then to "en" @@ -1702,7 +1703,7 @@ async def api_lang(request): lang_file = os.path.join(LANG_DIR, "en.json") # Load JSON translations - with open(lang_file, "r", encoding="utf-8") as f: + with open(lang_file, encoding="utf-8") as f: translations = json.load(f) if section: @@ -1711,8 +1712,7 @@ async def api_lang(request): return web.json_response(translations[section]) else: return web.json_response( - {"error": f"Section '{section}' not found in {lang_code}"}, - status=404 + {"error": f"Section '{section}' not found in {lang_code}"}, status=404 ) # if no section requested → return full translation file