Skip to content

Commit 7124ae0

Browse files
committed
add length to progress bar
so progress bar shows real progress Signed-off-by: Miroslav Suchý <[email protected]>
1 parent c40476a commit 7124ae0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.rst

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ v33.0.0 (next next, roadmap)
4040
- Update Dockerfile and test container build.
4141
See https://github.com/aboutcode-org/scancode-toolkit/issues/3955
4242

43+
- Progress bar now shows length. You can estimate the duration now.
44+
See https://github.com/aboutcode-org/scancode-toolkit/issues/3342
45+
4346
v32.3.0 - 2024-10-21
4447
--------------------
4548

src/scancode/cli.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1176,10 +1176,11 @@ def run_scanners(
11761176

11771177
progress_manager = None
11781178
if not quiet:
1179+
resources = list(((r.location, r.path) for r in codebase.walk() if r.is_file))
11791180
echo_func(f'Scan files for: {scan_names} with {processes} process(es)...')
11801181
item_show_func = partial(path_progress_message, verbose=verbose)
11811182
progress_manager = partial(progressmanager,
1182-
item_show_func=item_show_func,
1183+
item_show_func=item_show_func, length=len(resources)*2,
11831184
verbose=verbose, file=sys.stderr)
11841185

11851186
# TODO: add CLI option to bypass cache entirely?

0 commit comments

Comments
 (0)