Skip to content

Commit 88ff4ec

Browse files
Apply comments
Signed-off-by: Wonjae Park <[email protected]>
1 parent 6267260 commit 88ff4ec

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/fosslight_source/_parsing_scancode_file_item.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ def parsing_scancode_32_earlier(scancode_file_list: list, has_error: bool = Fals
170170
set(license_expression_list))
171171
result_item.comment = ','.join(license_expression_list)
172172

173-
# Check if this is a manifest file with license information
174173
if is_manifest_file(file_path):
175174
result_item.is_license_text = True
176175

@@ -275,7 +274,6 @@ def parsing_scancode_32_later(
275274
result_item.exclude = is_exclude_file(file_path)
276275
result_item.is_license_text = file.get("percentage_of_license_text", 0) > 90 or is_notice_file(file_path)
277276

278-
# Check if this is a manifest file with license information
279277
if is_manifest_file(file_path) and len(license_detected) > 0:
280278
result_item.is_license_text = True
281279

src/fosslight_source/_scan_item.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,12 @@ def is_exclude_file(file_path: str, prev_dir: str = None, prev_dir_exclude_value
140140

141141
def is_notice_file(file_path: str) -> bool:
142142
pattern = r"({})(?<!w)".format("|".join(_notice_filename))
143-
file_path = file_path.lower()
144143
filename = os.path.basename(file_path)
145-
return bool(re.match(pattern, filename))
144+
return bool(re.match(pattern, filename, re.IGNORECASE))
146145

147146

148147
def is_manifest_file(file_path: str) -> bool:
149148
"""Check if the file is a package manager manifest file."""
150149
pattern = r"({})$".format("|".join(_manifest_filename))
151-
file_path = file_path.lower()
152150
filename = os.path.basename(file_path)
153-
return bool(re.match(pattern, filename))
151+
return bool(re.match(pattern, filename, re.IGNORECASE))

0 commit comments

Comments
 (0)