Skip to content

Commit

Permalink
Use Codebase attibute paths for input paths
Browse files Browse the repository at this point in the history
Reference: #3452
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
  • Loading branch information
AyanSinhaMahapatra committed Aug 3, 2023
1 parent 5dfcfcb commit 822cc91
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/scancode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <input> format: "{}".'.format(repr(input))
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 822cc91

Please sign in to comment.