diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d115cda4b8..904dee3dbf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -108,6 +108,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 1376c6cfee..fd8a9c6c53 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -1264,6 +1264,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( @@ -1299,6 +1301,7 @@ def scan_codebase( if progress_manager: scans = progress_manager(scans) + scans.length = len(resources) # hack to avoid using a context manager if hasattr(scans, '__enter__'): scans.__enter__()