From 62e191abfc14a10ceaff966ed8e45889ac6ca04f Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Mon, 24 Aug 2026 16:28:28 -0400 Subject: [PATCH] fix(ci): lint ruff 0.16.3 - imports tries, check explicite, removeprefix - backend/main.py : split import csv / import io as csv_io (I001) - backend/version.py : check=False explicite sur subprocess.run (PLW1510) - backend/version.py : tag.removeprefix() au lieu du slice conditionnel (FURB188) - verifie localement avec ruff 0.16.3 : All checks passed! --- backend/main.py | 3 ++- backend/version.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/main.py b/backend/main.py index 15a327b..9c60da6 100644 --- a/backend/main.py +++ b/backend/main.py @@ -2484,7 +2484,8 @@ async def api_file(vault_name: str, path: str = Query(..., description="Relative # === CSV: render as HTML table === if ext == ".csv": - import csv, io as csv_io + import csv + import io as csv_io reader = csv.reader(csv_io.StringIO(raw)) rows = list(reader) if not rows: diff --git a/backend/version.py b/backend/version.py index 0fcfc67..333034b 100644 --- a/backend/version.py +++ b/backend/version.py @@ -26,13 +26,13 @@ def get_version() -> str: capture_output=True, text=True, timeout=5, + check=False, ) if result.returncode == 0: tag = result.stdout.strip() # git describe returns v1.7.0 or v1.7.0-3-gabc1234 # Remove leading 'v' if present - if tag.startswith("v"): - tag = tag[1:] + tag = tag.removeprefix("v") return tag except (FileNotFoundError, subprocess.TimeoutExpired, OSError): pass