From 0aae7d0bea424a928b6a0be94c445147eb7795dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 23 Aug 2026 10:20:43 +0200 Subject: [PATCH] STYE: Avoid shadowing symbols from outer scope Rename variable names/parameters to avoid shadowing symbols from outer scope. Fixes: ``` Shadows name 'info' from outer scope ``` and ``` Shadows name 'clean' from outer scope ``` raised locally by IDE. --- .spin/cmds.py | 6 +++--- trx/cli.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.spin/cmds.py b/.spin/cmds.py index 5269933..d4fcd27 100644 --- a/.spin/cmds.py +++ b/.spin/cmds.py @@ -213,12 +213,12 @@ def lint(fix): default=False, help="Open documentation in browser after building", ) -def docs(clean, open_browser): +def docs(_clean, open_browser): """Build documentation using Sphinx. Parameters ---------- - clean : bool + _clean : bool If True, clean build directory before building. open_browser : bool If True, open documentation in browser after building. @@ -227,7 +227,7 @@ def docs(clean, open_browser): docs_dir = "docs" - if clean: + if _clean: click.echo("Cleaning build directory...") build_dir = os.path.join(docs_dir, "_build") if os.path.exists(build_dir): diff --git a/trx/cli.py b/trx/cli.py index 9ffade0..079b17b 100644 --- a/trx/cli.py +++ b/trx/cli.py @@ -993,8 +993,8 @@ def info( typer.echo(f"Size: {_format_size(file_size)}") with zipfile.ZipFile(str(in_tractogram), "r") as zf: - total_uncompressed = sum(info.file_size for info in zf.infolist()) - is_compressed = any(info.compress_type != 0 for info in zf.infolist()) + total_uncompressed = sum(_info.file_size for _info in zf.infolist()) + is_compressed = any(_info.compress_type != 0 for _info in zf.infolist()) typer.echo(f"Entries: {len(zf.infolist())}") typer.echo(f"Compressed: {'Yes' if is_compressed else 'No'}") typer.echo(f"Uncompressed size: {_format_size(total_uncompressed)}")