Skip to content

Commit

Permalink
add length to progress bar
Browse files Browse the repository at this point in the history
so progress bar shows real progress

Signed-off-by: Miroslav Suchý <[email protected]>
  • Loading branch information
xsuchy committed Jan 16, 2025
1 parent b0aff52 commit a3bbe76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ v33.0.0 (next next, roadmap)
- Update Dockerfile and test container build.
See https://github.com/aboutcode-org/scancode-toolkit/issues/3955

- Progress bar now shows length. You can estimate the duration now.
See https://github.com/aboutcode-org/scancode-toolkit/issues/3342

v32.3.1 - 2024-01-06
--------------------

Expand Down
3 changes: 2 additions & 1 deletion src/scancode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1176,10 +1176,11 @@ def run_scanners(

progress_manager = None
if not quiet:
resources = list(((r.location, r.path) for r in codebase.walk() if r.is_file))
echo_func(f'Scan files for: {scan_names} with {processes} process(es)...')
item_show_func = partial(path_progress_message, verbose=verbose)
progress_manager = partial(progressmanager,
item_show_func=item_show_func,
item_show_func=item_show_func, length=len(resources)*2,
verbose=verbose, file=sys.stderr)

# TODO: add CLI option to bypass cache entirely?
Expand Down

0 comments on commit a3bbe76

Please sign in to comment.