From bd7291e9ef21e822877285a0879adc113f821157 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sat, 2 May 2026 05:26:47 +0000 Subject: [PATCH] Lint: unused arguments --- cista/api.py | 3 +++ cista/app.py | 2 ++ cista/auth.py | 2 ++ cista/fileserver.py | 2 ++ cista/preview_worker.py | 1 + cista/serve.py | 1 + cista/server80.py | 2 ++ cista/sso.py | 2 ++ cista/watching.py | 3 +++ pyproject.toml | 3 +-- 10 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cista/api.py b/cista/api.py index 12e28a7..9dd6c06 100644 --- a/cista/api.py +++ b/cista/api.py @@ -22,11 +22,13 @@ fileserver = FileServer() @bp.before_server_start async def start_fileserver(app): + _ = app await fileserver.start() @bp.after_server_stop async def stop_fileserver(app): + _ = app await fileserver.stop() @@ -100,6 +102,7 @@ async def watch(req, ws): def subscribe(uuid, ws): + _ = ws with watching.state.lock: q = watching.pubsub[uuid] = asyncio.Queue() # Init with disk usage and full tree diff --git a/cista/app.py b/cista/app.py index 45b2b45..e479026 100644 --- a/cista/app.py +++ b/cista/app.py @@ -141,6 +141,7 @@ async def main_start(app): @app.after_server_start async def main_after_start(app): + _ = app onlyoffice.log_reachable_info() @@ -255,6 +256,7 @@ async def wwwroot(req, path=""): @app.route("/favicon.ico", methods=["GET", "HEAD"]) async def favicon(req): + _ = req # Browsers keep asking for it when viewing files (not HTML with icon link) return redirect("/assets/logo-ctv8tVwU.svg", status=308) diff --git a/cista/auth.py b/cista/auth.py index 427fba1..fbb15ff 100644 --- a/cista/auth.py +++ b/cista/auth.py @@ -268,6 +268,7 @@ def _log_webdav_user_agent_once(request, user_agent: str): def _build_ua_auth_headers(request, *, include_hint=False) -> dict[str, str]: + _ = include_hint user_agent = request.headers.get("user-agent", "") _log_webdav_user_agent_once(request, user_agent) if _is_windows_auth_client(user_agent): @@ -1081,6 +1082,7 @@ async def login_page(request): def _login_success_page(username: str) -> str: """Minimal page that signals auth-success to parent iframe.""" + _ = username return str( Document().script_("window.parent.postMessage({type:'auth-success'},'*')") ) diff --git a/cista/fileserver.py b/cista/fileserver.py index 855ee2c..b02e6c9 100644 --- a/cista/fileserver.py +++ b/cista/fileserver.py @@ -281,6 +281,8 @@ async def head_file(request, name=""): @bp.route("/", methods=["OPTIONS"], name="options_root", strict_slashes=False) @bp.route("/", methods=["OPTIONS"], name="options_path") async def dav_options(request, name=""): + _ = request + _ = name return HTTPResponse( status=200, headers={ diff --git a/cista/preview_worker.py b/cista/preview_worker.py index 315dd24..408e2d6 100644 --- a/cista/preview_worker.py +++ b/cista/preview_worker.py @@ -266,6 +266,7 @@ def process_image_pyvips(path, *, maxsize, quality): def process_image_buffer(data: bytes, *, quality, maxsize, maxzoom): + _ = maxzoom t_start = perf_counter() img = pyvips.Image.new_from_buffer(data, "") img = img.autorot() diff --git a/cista/serve.py b/cista/serve.py index 79e1439..3d0fb4d 100644 --- a/cista/serve.py +++ b/cista/serve.py @@ -35,6 +35,7 @@ def run(*, dev=False): def check_cert(certdir, domain): + _ = domain if (certdir / "privkey.pem").exist() and (certdir / "fullchain.pem").exists(): return # Certificate provisioning is external; files must exist before startup. diff --git a/cista/server80.py b/cista/server80.py index d4c7486..f06cea6 100644 --- a/cista/server80.py +++ b/cista/server80.py @@ -6,6 +6,7 @@ app = Sanic("server80") # Send all HTTP users to HTTPS @app.exception(exceptions.NotFound, exceptions.MethodNotSupported) def redirect_everything_else(request, exception): + _ = exception server, path = request.server_name, request.path if server and path.startswith("/"): return response.redirect(f"https://{server}{path}", status=308) @@ -15,6 +16,7 @@ def redirect_everything_else(request, exception): # ACME challenge for LetsEncrypt @app.get("/.well-known/acme-challenge/") async def letsencrypt(request, challenge): + _ = request try: return response.text(acme_challenges[challenge]) except KeyError: diff --git a/cista/sso.py b/cista/sso.py index 4c6d8d3..b5fa160 100644 --- a/cista/sso.py +++ b/cista/sso.py @@ -349,6 +349,7 @@ bp = Blueprint("sso", url_prefix="/auth") @bp.websocket("/ws/") async def auth_websocket_proxy(request, ws, path=""): """Proxy WebSocket connections to the auth backend.""" + _ = path await proxy_auth_websocket(request, ws) @@ -363,6 +364,7 @@ async def auth_websocket_proxy_root(request, ws): ) async def auth_proxy(request, path=""): """Proxy all auth requests to the auth backend.""" + _ = path return await proxy_auth_request(request) diff --git a/cista/watching.py b/cista/watching.py index 63f46b0..6693598 100644 --- a/cista/watching.py +++ b/cista/watching.py @@ -31,6 +31,7 @@ if sys.platform == "win32": def get_allocated_size(path: Path, st: stat_result) -> int: """Get actual disk allocation on Windows using GetCompressedFileSizeW.""" + _ = st high = wintypes.DWORD() low = GetCompressedFileSizeW(str(path), ctypes.byref(high)) if low == INVALID_FILE_SIZE and ctypes.get_last_error() != 0: @@ -41,6 +42,7 @@ else: def get_allocated_size(path: Path, st: stat_result) -> int: """Get actual disk allocation on Unix using st_blocks.""" + _ = path # st_blocks is in 512-byte units return st.st_blocks * 512 @@ -249,6 +251,7 @@ def update_root(loop): def update_path(rootmod: list[FileEntry], relpath: PurePosixPath, loop): """Called on FS updates, check the filesystem and broadcast any changes.""" new = walk(relpath) + _ = loop obegin, old = treeget(rootmod, relpath) if old == new: diff --git a/pyproject.toml b/pyproject.toml index 85b8541..8b8fa67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,7 +130,6 @@ ignore = [ "ANN202", # legacy codebase: no full runtime annotation coverage yet "ANN204", # legacy codebase: no full runtime annotation coverage yet "ANN205", # legacy codebase: no full runtime annotation coverage yet - "ARG001", # framework and callback signatures commonly require unused args "BLE001", # broad catch remains in boundary/proxy/error-handling paths "C901", # legacy complexity; keep other correctness rules enabled "D100", # legacy docs not yet standardized @@ -161,7 +160,7 @@ ignore = [ "TRY003", # exception-message strictness too noisy on legacy handlers ] isort.known-first-party = ["cista"] -per-file-ignores."tests/*" = ["S", "ANN", "D", "INP", "PLR2004"] +per-file-ignores."tests/*" = ["S", "ANN", "D", "INP", "PLR2004", "ARG001"] per-file-ignores."scripts/*" = ["T20"] [dependency-groups]