Skip to content

Commit 321a768

Browse files
Refine license name on SCANOSS results
1 parent 4aec327 commit 321a768

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/fosslight_source/_parsing_scanoss_file.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import fosslight_util.constant as constant
88
from ._scan_item import ScanItem
99
from ._scan_item import is_exclude_file
10+
from ._scan_item import replace_word
1011

1112
logger = logging.getLogger(constant.LOGGER_NAME)
1213
SCANOSS_INFO_HEADER = ['No', 'Source Name or Path', 'Component Declared', 'SPDX Tag',
@@ -52,7 +53,13 @@ def parsing_scanResult(scanoss_report):
5253
copyright_detected = []
5354
if 'licenses' in findings[0]:
5455
for license in findings[0]['licenses']:
55-
license_detected.append(license['name'].lower())
56+
57+
license_lower = license['name'].lower()
58+
for word in replace_word:
59+
if word in license_lower:
60+
license_lower = license_lower.replace(word, "")
61+
license_detected.append(license_lower)
62+
5663
if license['source'] not in license_w_source:
5764
license_w_source[license['source']] = []
5865
license_w_source[license['source']].append(license['name'])

0 commit comments

Comments
 (0)