Skip to content

Commit 4b97137

Browse files
authored
Merge pull request #101 from fosslight/temp2
Fix bug where path in sbom-info.yaml is not excluded from lint result
2 parents c78fd04 + 3d595ad commit 4b97137

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/fosslight_prechecker/_result.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,6 @@ def create_result_file(output_file_name, format='', _start_time=""):
215215
return result_file, output_path, output_extension
216216

217217

218-
def get_only_pkg_info_yaml_file(pkg_info_files):
219-
for yaml_file in pkg_info_files:
220-
try:
221-
if re.search(r"oss-pkg-info[\s\S]*.yaml", os.path.basename(yaml_file).lower()):
222-
yield yaml_file
223-
except Exception as ex:
224-
logger.debug(f"Error to find oss-pkg-info*.yaml: {ex}")
225-
226-
227218
def get_path_in_yaml(oss_item):
228219
return [os.path.join(oss_item.relative_path, file) for file in oss_item.source_name_or_path]
229220

@@ -287,9 +278,8 @@ def result_for_summary(path_to_find, oss_pkg_info_files, license_missing_files,
287278

288279
if oss_pkg_info_files:
289280
oss_yaml_files = find_sbom_yaml_files(path_to_find)
290-
yaml_file = get_only_pkg_info_yaml_file(oss_yaml_files)
291281
# Exclude files in yaml
292-
license_missing_files, copyright_missing_files = exclude_file_in_yaml(path_to_find, yaml_file,
282+
license_missing_files, copyright_missing_files = exclude_file_in_yaml(path_to_find, oss_yaml_files,
293283
set(license_missing_files) - set(oss_pkg_info_files),
294284
set(copyright_missing_files) - set(oss_pkg_info_files))
295285

0 commit comments

Comments
 (0)