Skip to content

Commit

Permalink
fix(spdx-reporter): Remove a conflicting license validity check
Browse files Browse the repository at this point in the history
The `SpdxPackage` constructor already performs a different check with
`Strictness.ALLOW_LICENSEREF_EXCEPTIONS`, see [1]. Remove the check here
to only check once with an aligned strictness. This changes behavior so
that now `LicenseRef`-exceptions are accepted as intended by aa3959e.
Because such exceptions are not part of the SPDX specification, their use
gets logged as warnings, see 4084133.

[1]: https://github.com/oss-review-toolkit/ort/blob/8f00ece/utils/spdx/src/main/kotlin/model/SpdxPackage.kt#L223

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Oct 30, 2024
1 parent b4d9313 commit fe7d1ef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions plugins/reporters/spdx/src/main/kotlin/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,7 @@ internal fun Package.toSpdxPackage(
licenseInfoResolver.resolveLicenseInfo(id)
.filterExcluded()
.filter(LicenseView.ONLY_DETECTED)
.map { resolvedLicense ->
resolvedLicense.license.takeIf { it.isValid(SpdxExpression.Strictness.ALLOW_DEPRECATED) }
.nullOrBlankToSpdxNoassertionOrNone()
}
.map { it.license.nullOrBlankToSpdxNoassertionOrNone() }
.distinct()
.sorted()
},
Expand Down

0 comments on commit fe7d1ef

Please sign in to comment.