From 6b68dd895aada449c6e5d7a9cc3917cc17442a8a Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 18 Dec 2024 13:34:30 +0100 Subject: [PATCH] chore(aosd): Rename a few variables to singular These are not collections SPDX of expressions. Signed-off-by: Sebastian Schuberth --- .../reporters/aosd/src/main/kotlin/Aosd21Reporter.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/reporters/aosd/src/main/kotlin/Aosd21Reporter.kt b/plugins/reporters/aosd/src/main/kotlin/Aosd21Reporter.kt index d9ec2cfc3985e..2a6360cc18a81 100644 --- a/plugins/reporters/aosd/src/main/kotlin/Aosd21Reporter.kt +++ b/plugins/reporters/aosd/src/main/kotlin/Aosd21Reporter.kt @@ -85,16 +85,16 @@ private fun Map>.toComponents( val nonExcludedLicenseInfo = input.licenseInfoResolver.resolveLicenseInfo(pkg.metadata.id).filterExcluded() val relevantLicenseInfo = nonExcludedLicenseInfo.filter(LicenseView.CONCLUDED_OR_DECLARED_AND_DETECTED) - val licenseExpressions = relevantLicenseInfo.toSimplifiedCompoundExpression() + val licenseExpression = relevantLicenseInfo.toSimplifiedCompoundExpression() val selectedLicenseInfo = relevantLicenseInfo .applyChoices(input.ortResult.getPackageLicenseChoices(pkg.metadata.id)) .applyChoices(input.ortResult.getRepositoryLicenseChoices()) - val selectedExpressions = selectedLicenseInfo.toSimplifiedCompoundExpression() - .takeUnless { it == licenseExpressions } + val selectedExpression = selectedLicenseInfo.toSimplifiedCompoundExpression() + .takeUnless { it == licenseExpression } - val licenseTexts = licenseExpressions.licenses().mapNotNullTo(mutableSetOf()) { license -> + val licenseTexts = licenseExpression.licenses().mapNotNullTo(mutableSetOf()) { license -> input.licenseTextProvider.getLicenseText(license) }.joinToString("\n--\n") { it.trimEnd() } @@ -111,13 +111,13 @@ private fun Map>.toComponents( subcomponents = listOf( AOSD21.Subcomponent( subcomponentName = FIRST_SUBCOMPONENT_NAME, - spdxId = licenseExpressions.nullOrBlankToSpdxNoassertionOrNone(), + spdxId = licenseExpression.nullOrBlankToSpdxNoassertionOrNone(), copyrights = relevantLicenseInfo.getCopyrights().sorted(), authors = pkg.metadata.authors.sorted(), licenseText = licenseTexts, // Can be empty as the license information is the result of a file level scan. licenseTextUrl = "", - selectedLicense = selectedExpressions?.toString().orEmpty() + selectedLicense = selectedExpression?.toString().orEmpty() ).validate() ) ).validate()