From ea4f6243e95ef796f112cd4273f175e2a8a980c4 Mon Sep 17 00:00:00 2001 From: Wonjae Park Date: Wed, 28 Dec 2022 15:28:14 +0900 Subject: [PATCH] Add remove_licensese for Scancode --- src/fosslight_source/_parsing_scancode_file_item.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fosslight_source/_parsing_scancode_file_item.py b/src/fosslight_source/_parsing_scancode_file_item.py index 03b63a5..5c853d1 100755 --- a/src/fosslight_source/_parsing_scancode_file_item.py +++ b/src/fosslight_source/_parsing_scancode_file_item.py @@ -18,6 +18,7 @@ _exclude_directory = [os.path.sep + dir_name + os.path.sep for dir_name in _exclude_directory] _exclude_directory.append("/.") +remove_license = ["warranty-disclaimer"] def get_error_from_header(header_item): @@ -102,6 +103,10 @@ def parsing_file_item(scancode_file_list, has_error, need_matched_license=False) for lic_item in licenses: license_value = "" key = lic_item.get("key", "") + if key in remove_license: + if key in license_expression_list: + license_expression_list.remove(key) + continue spdx = lic_item.get("spdx_license_key", "") # logger.debug("LICENSE_KEY:"+str(key)+",SPDX:"+str(spdx))