Skip to content

Commit a3bbe76

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

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
@@ -38,6 +38,9 @@ v33.0.0 (next next, roadmap)
3838
- Update Dockerfile and test container build.
3939
See https://github.com/aboutcode-org/scancode-toolkit/issues/3955
4040

41+
- Progress bar now shows length. You can estimate the duration now.
42+
See https://github.com/aboutcode-org/scancode-toolkit/issues/3342
43+
4144
v32.3.1 - 2024-01-06
4245
--------------------
4346

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)