Skip to content

Commit 4b6aad3

Browse files
committed
refactor(tools/curations): Use a shorter name for a constant
Signed-off-by: Frank Viernau <[email protected]>
1 parent 28f0e47 commit 4b6aad3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tools/curations/buildSrc/src/main/kotlin/ScanCodeLicenseDbClassifications.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ private val JSON_MAPPER = JsonMapper().apply {
4444
propertyNamingStrategy = PropertyNamingStrategies.SNAKE_CASE
4545
}
4646

47-
private const val CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT = "cla"
47+
private const val CATEGORY_CLA = "cla"
4848
private const val CATEGORY_GENERIC = "generic"
4949
private const val CATEGORY_UNKNOWN = "unknown"
5050

5151
private val OVERRIDE_LICENSE_CATEGORIES = mapOf(
52-
"LicenseRef-scancode-cncf-corporate-cla-1.0" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
53-
"LicenseRef-scancode-cncf-individual-cla-1.0" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
54-
"LicenseRef-scancode-google-cla" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
55-
"LicenseRef-scancode-google-corporate-cla" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
56-
"LicenseRef-scancode-jetty-ccla-1.1" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
57-
"LicenseRef-scancode-ms-cla" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
58-
"LicenseRef-scancode-newton-king-cla" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
59-
"LicenseRef-scancode-owf-cla-1.0-copyright" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
60-
"LicenseRef-scancode-owf-cla-1.0-copyright-patent" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT,
61-
"LicenseRef-scancode-square-cla" to CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT
52+
"LicenseRef-scancode-cncf-corporate-cla-1.0" to CATEGORY_CLA,
53+
"LicenseRef-scancode-cncf-individual-cla-1.0" to CATEGORY_CLA,
54+
"LicenseRef-scancode-google-cla" to CATEGORY_CLA,
55+
"LicenseRef-scancode-google-corporate-cla" to CATEGORY_CLA,
56+
"LicenseRef-scancode-jetty-ccla-1.1" to CATEGORY_CLA,
57+
"LicenseRef-scancode-ms-cla" to CATEGORY_CLA,
58+
"LicenseRef-scancode-newton-king-cla" to CATEGORY_CLA,
59+
"LicenseRef-scancode-owf-cla-1.0-copyright" to CATEGORY_CLA,
60+
"LicenseRef-scancode-owf-cla-1.0-copyright-patent" to CATEGORY_CLA,
61+
"LicenseRef-scancode-square-cla" to CATEGORY_CLA
6262
).mapKeys { (license, _) -> SpdxSingleLicenseExpression.parse(license) }
6363

6464
private data class License(
@@ -162,7 +162,7 @@ private fun LicenseDetails.getCategories(): Set<String> {
162162
mappedCategory,
163163
// Include all licenses into the notice file to ensure there is no under-reporting by default.
164164
"include-in-notice-file".takeUnless {
165-
mappedCategory in setOf(CATEGORY_UNKNOWN, CATEGORY_GENERIC, CATEGORY_CONTRIBUTOR_LICENSE_AGREEMENT)
165+
mappedCategory in setOf(CATEGORY_UNKNOWN, CATEGORY_GENERIC, CATEGORY_CLA)
166166
},
167167
// The FSF has stated that a source code offer is required for Copyleft (limited) licences, so
168168
// include only these to not cause unnecessary effort by default.

0 commit comments

Comments
 (0)