Skip to content

Commit

Permalink
chore(fossid): Add affected path for unmappable licenses
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
MarcelBochtler committed Dec 18, 2024
1 parent 8e9f0cf commit 0aa9731
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/scanners/fossid/src/main/kotlin/FossIdScanResults.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 0aa9731

Please sign in to comment.