From 822cc91d895f1fac0793ba4f400fc1ebd04041bc Mon Sep 17 00:00:00 2001 From: Ayan Sinha Mahapatra Date: Thu, 3 Aug 2023 19:33:52 +0530 Subject: [PATCH] Use Codebase attibute paths for input paths Reference: https://github.com/nexB/scancode-toolkit/issues/3452 Signed-off-by: Ayan Sinha Mahapatra --- src/scancode/cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 1e6bc0dc51e..b1e1d8562cd 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -546,6 +546,7 @@ def echo_func(*_args, **_kwargs): msg = 'At least one input path is required.' raise ScancodeError(msg) + included_paths = None if not isinstance(input, (list, tuple)): if not isinstance(input, str): msg = 'Unknown format: "{}".'.format(repr(input)) @@ -594,9 +595,9 @@ def echo_func(*_args, **_kwargs): # the input list of paths included_paths = [as_posixpath(path).rstrip('/') for path in input] # FIXME: this is a hack as this "include" is from an external plugin!!! - include = list(requested_options.get('include', []) or []) - include.extend(included_paths) - requested_options['include'] = include + #include = list(requested_options.get('include', []) or []) + #include.extend(included_paths) + #requested_options['include'] = include # ... and use the common prefix as our new input input = common_prefix # NOQA @@ -616,6 +617,7 @@ def echo_func(*_args, **_kwargs): test_mode=test_mode, test_slow_mode=test_slow_mode, test_error_mode=test_error_mode, + paths=included_paths, ) requested_options.update(standard_options)