Skip to content

Commit d71598f

Browse files
committed
Implemented a custom Detekt rule for JUnit 5 @TestFactory functions that don't have a valid return type. Improved Detekt configuration.
1 parent c7eb89d commit d71598f

File tree

19 files changed

+432
-1117
lines changed

19 files changed

+432
-1117
lines changed

build-logic/settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ dependencyResolutionManagement {
1919
}
2020

2121
includeBuild("../platforms")
22+
includeBuild("../detekt-rules")
2223

2324
rootProject.name = "build-logic"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
plugins {
2+
kotlin("jvm")
3+
// Version catalog type-safe accessors and extension not yet available in
4+
// plugins block of precompiled script plugins:
5+
// https://github.com/gradle/gradle/issues/15383
6+
// alias(libs.plugins.detekt.gradle.plugin)
7+
id("io.gitlab.arturbosch.detekt")
8+
}
9+
10+
dependencies {
11+
12+
detektPlugins("org.sdkotlin.detekt:detekt-rules:1.0-SNAPSHOT")
13+
}
14+
15+
tasks {
16+
named<Task>("check").configure {
17+
this.setDependsOn(this.dependsOn.filterNot {
18+
it is TaskProvider<*> && it.name == "detekt"
19+
})
20+
21+
val detektMain by existing
22+
dependsOn(detektMain)
23+
24+
val detektTest by existing
25+
dependsOn(detektTest)
26+
}
27+
}

build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ plugins {
77
// https://github.com/gradle/gradle/issues/15383
88
// alias(libs.plugins.dependency.analysis.gradle.plugin)
99
id("com.autonomousapps.dependency-analysis")
10-
// alias(libs.plugins.detekt.gradle.plugin)
11-
id("io.gitlab.arturbosch.detekt")
1210
// alias(libs.plugins.jvm.dependency.conflict.detection.gradle.plugin)
1311
id("org.gradlex.jvm-dependency-conflict-detection")
12+
id("org.sdkotlin.buildlogic.detekt-project")
1413
}
1514

1615
val javaTargetVersion: String = JavaVersion.VERSION_21.toString()

0 commit comments

Comments
 (0)