From b67adbe0b00bb2d3b240ad7393a82948fed496e6 Mon Sep 17 00:00:00 2001 From: Marcel Bochtler Date: Wed, 18 Dec 2024 15:11:10 +0100 Subject: [PATCH] chore(fossid): Add affected path for unmappable licenses When FossID reports non-SPDX licenses, it is hard to find the file that initially contained this invalid license. Improve the user experience by adding the file path to the issue message. Signed-off-by: Marcel Bochtler --- plugins/scanners/fossid/src/main/kotlin/FossIdScanResults.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/scanners/fossid/src/main/kotlin/FossIdScanResults.kt b/plugins/scanners/fossid/src/main/kotlin/FossIdScanResults.kt index b54fde071142b..ea85e12fd8b1f 100644 --- a/plugins/scanners/fossid/src/main/kotlin/FossIdScanResults.kt +++ b/plugins/scanners/fossid/src/main/kotlin/FossIdScanResults.kt @@ -156,7 +156,8 @@ private fun mapLicense( }.onFailure { spdxException -> issues += FossId.createAndLogIssue( source = "FossId", - message = "Failed to parse license '$license' as an SPDX expression: ${spdxException.collectMessages()}" + message = "Failed to parse license '$license' as an SPDX expression: ${spdxException.collectMessages()}", + affectedPath = location.path ) }.getOrNull() }