in scancode/scanCode.py [0:0]
def read_path_inclusions(config):
"""Read the list of paths to include in scan tests."""
inclusion_dict = get_config_section_dict(config, SECTION_INCLUDE)
# vprint("inclusion_dict: " + str(inclusion_dict))
for key in inclusion_dict:
all_checks = inclusion_dict[key]
# strip off all whitespace, regardless of index
all_checks = all_checks.replace(' ', '')
# retrieve the names of all functions to scan for
# the respective filename (wildcards allowed)
function_names = all_checks.split(',')
file_check_fxs = []
line_check_fxs = []
for fname in function_names:
try:
fx = globals()[fname]
if fname in FILE_CHECK_FUNCTIONS:
file_check_fxs.append(fx)
elif fname in LINE_CHECK_FUNCTIONS:
line_check_fxs.append(fx)
except Exception:
print_error(ERR_INVALID_SCAN_FUNCTION % (key, fname))
sys.exit(1)
a_tuple = (key, file_check_fxs, line_check_fxs)
FILTERS_WITH_CHECK_FUNCTIONS.append(a_tuple)