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") {
13541354 )
13551355}
13561356
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+
13571370fun RuleSet.packageConfigurationInOrtYmlRule () = ortResultRule(" PACKAGE_CONFIGURATION_IN_ORT_YML" ) {
13581371 if (ortResult.repository.config.packageConfigurations.isNotEmpty()) {
13591372 error(
@@ -1572,6 +1585,7 @@ fun RuleSet.commonRules() {
15721585 packageCurationInOrtYmlRule()
15731586
15741587 // Rules for dependencies:
1588+ noLicenseInDependencyRule()
15751589 vulnerabilityInDependencyRule()
15761590 vulnerabilityWithHighSeverityInDependencyRule()
15771591
You can’t perform that action at this time.
0 commit comments