Skip to content

Commit 7930646

Browse files
committed
add length to progress bar
so progress bar shows real progress Signed-off-by: Miroslav Suchý <msuchy@redhat.com>
1 parent f620729 commit 7930646

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ This is a patch release with bugfixes and improvements::
108108
https://github.com/aboutcode-org/scancode-toolkit/pull/4476
109109

110110

111+
- Progress bar now shows length. You can estimate the duration now.
112+
See https://github.com/aboutcode-org/scancode-toolkit/issues/3342
113+
111114
v32.4.0 - 2025-06-26
112115
--------------------
113116

src/scancode/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,8 @@ def scan_codebase(
12641264

12651265
# NOTE: we never scan directories
12661266
resources = ((r.location, r.path) for r in codebase.walk() if r.is_file)
1267+
if progress_manager:
1268+
resources = list(resources)
12671269

12681270
use_threading = processes >= 0
12691271
runner = partial(
@@ -1299,6 +1301,7 @@ def scan_codebase(
12991301

13001302
if progress_manager:
13011303
scans = progress_manager(scans)
1304+
scans.length = len(resources)
13021305
# hack to avoid using a context manager
13031306
if hasattr(scans, '__enter__'):
13041307
scans.__enter__()

0 commit comments

Comments
 (0)