Skip to content

Commit 68d436a

Browse files
JustinWonjaeParksoimkim
authored andcommitted
Fix Comment column output
1 parent c4c1c5e commit 68d436a

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

src/fosslight_source/_parsing_scanoss_file.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ def parsing_scanResult(scanoss_report):
4343
if is_exclude_file(file_path):
4444
result_item.set_exclude(True)
4545

46-
comment = ""
47-
comment += "Match Type : " + findings[0]['id'] + ", "
4846
if 'vendor' in findings[0]:
49-
comment += "Vendor : " + findings[0]['vendor'] + ", "
47+
result_item.set_vendor(findings[0]['vendor'])
5048
if 'file_url' in findings[0]:
51-
comment += "File URL : " + findings[0]['file_url'] + ", "
49+
result_item.set_fileURL(findings[0]['file_url'])
5250
if 'matched' in findings[0]:
53-
comment += "Matched : " + findings[0]['matched'] + ", "
54-
if 'lines' in findings[0]:
55-
comment += "Lines : " + findings[0]['lines']
56-
result_item.set_comment(comment)
51+
if 'lines' in findings[0]:
52+
result_item.set_matched_lines(findings[0]['matched'] + " (" + findings[0]['lines'] + ")")
53+
else:
54+
result_item.set_matched_lines(findings[0]['matched'])
55+
elif 'lines' in findings[0]:
56+
result_item.set_matched_lines("(" + findings[0]['lines'] + ")")
5757

5858
scanoss_file_item.append(result_item)
5959

src/fosslight_source/_scan_item.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class ScanItem:
2929
oss_name = ""
3030
oss_version = ""
3131
download_location = ""
32+
matched_lines = "" # for scanoss
33+
fileURL = "" # for scanoss
34+
vendor = "" # for scanoss
3235

3336
def __init__(self, value):
3437
self.file = value
@@ -72,6 +75,15 @@ def set_oss_version(self, value):
7275
def set_download_location(self, value):
7376
self.download_location = value
7477

78+
def set_matched_lines(self, value):
79+
self.matched_lines = value
80+
81+
def set_fileURL(self, value):
82+
self.fileURL = value
83+
84+
def set_vendor(self, value):
85+
self.vendor = value
86+
7587
def get_row_to_print(self):
7688
if not self.download_location:
7789
print_rows = [self.file, "", "", ','.join(self.licenses), "", "",

0 commit comments

Comments
 (0)