diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0d745db06a..b1f0114e2b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -42,6 +42,9 @@ This is a patch release with bugfixes and improvements:: https://github.com/aboutcode-org/scancode-toolkit/pull/4476 +- Progress bar now shows length. You can estimate the duration now. + See https://github.com/aboutcode-org/scancode-toolkit/issues/3342 + v32.4.0 - 2025-06-26 -------------------- diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 9369fe7d91..293932aca9 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -1252,6 +1252,8 @@ def scan_codebase( # NOTE: we never scan directories resources = ((r.location, r.path) for r in codebase.walk() if r.is_file) + if progress_manager: + resources = list(resources) use_threading = processes >= 0 runner = partial( @@ -1287,6 +1289,8 @@ def scan_codebase( if progress_manager: scans = progress_manager(scans) + # times two because of #3344 + scans.length = len(resources)*2 # hack to avoid using a context manager if hasattr(scans, '__enter__'): scans.__enter__()