File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1354,6 +1354,19 @@ fun RuleSet.missingTestsRule() = projectSourceRule("MISSING_TESTS") {
1354
1354
)
1355
1355
}
1356
1356
1357
+ fun RuleSet.noLicenseInDependencyRule () = dependencyRule(" NO_LICENSE_IN_DEPENDENCY" ) {
1358
+ require {
1359
+ - hasLicense()
1360
+ - isExcluded()
1361
+ }
1362
+
1363
+ error(
1364
+ " No license information is available for dependency '${pkg.metadata.id.toCoordinates()} '." ,
1365
+ " If the dependency indeed is unlicensed, it must not be used. Otherwise, please conclude the appropriate " +
1366
+ " license with a package curation."
1367
+ )
1368
+ }
1369
+
1357
1370
fun RuleSet.packageConfigurationInOrtYmlRule () = ortResultRule(" PACKAGE_CONFIGURATION_IN_ORT_YML" ) {
1358
1371
if (ortResult.repository.config.packageConfigurations.isNotEmpty()) {
1359
1372
error(
@@ -1572,6 +1585,7 @@ fun RuleSet.commonRules() {
1572
1585
packageCurationInOrtYmlRule()
1573
1586
1574
1587
// Rules for dependencies:
1588
+ noLicenseInDependencyRule()
1575
1589
vulnerabilityInDependencyRule()
1576
1590
vulnerabilityWithHighSeverityInDependencyRule()
1577
1591
You can’t perform that action at this time.
0 commit comments