Skip to content

Commit 43b8646

Browse files
committed
refactor(tools/curations): Factor out constants for copyleft categories
Enable re-use in an upcoming change. Signed-off-by: Frank Viernau <[email protected]>
1 parent 4204422 commit 43b8646

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

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

47+
private const val CATEGORY_COPYLEFT = "copyleft"
48+
private const val CATEGORY_COPYLEFT_LIMITED = "copyleft-limited"
4749
private const val CATEGORY_CLA = "cla"
4850
private const val CATEGORY_GENERIC = "generic"
4951
private const val CATEGORY_PERMISSIVE = "permissive"
@@ -177,7 +179,9 @@ private fun addExtraCategories(category: String): Set<String> =
177179
},
178180
// The FSF has stated that a source code offer is required for Copyleft (limited) licences, so
179181
// include only these to not cause unnecessary effort by default.
180-
"include-source-code-offer-in-notice-file".takeIf { category in setOf("copyleft", "copyleft-limited") }
182+
"include-source-code-offer-in-notice-file".takeIf {
183+
category in setOf(CATEGORY_COPYLEFT, CATEGORY_COPYLEFT_LIMITED)
184+
}
181185
)
182186

183187
private fun getLicenseClassifications(licenseDetails: Collection<LicenseDetails>): LicenseClassifications {

0 commit comments

Comments
 (0)