Skip to content

Commit 7d6890f

Browse files
committed
Remove SPDX, URL from copyright
1 parent 318ecad commit 7d6890f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/fosslight_source/_parsing_scancode_file_item.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ def parsing_file_item(scancode_file_list, has_error, need_matched_license=False)
8585
else:
8686
copyright_data = x.get("value", "")
8787
if copyright_data:
88+
try:
89+
copyright_data = re.sub(r'SPDX-License-Identifier\s*[\S]+', '', copyright_data, flags=re.I)
90+
copyright_data = re.sub(r'DownloadLocation\s*[\S]+', '', copyright_data, flags=re.I).strip()
91+
except Exception:
92+
pass
8893
copyright_value_list.append(copyright_data)
8994

9095
result_item.copyright = copyright_value_list

0 commit comments

Comments
 (0)