Skip to content

Commit ab2106d

Browse files
authored
Merge pull request #52 from nhajratw/add-detekt
Add detekt
2 parents f525727 + 504c0be commit ab2106d

File tree

14 files changed

+923
-200
lines changed

14 files changed

+923
-200
lines changed

build.gradle.kts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
kotlin("jvm") version "1.4.31"
66
`maven-publish`
77
id("com.github.ben-manes.versions") version "0.38.0"
8+
id("io.gitlab.arturbosch.detekt") version "1.16.0"
89
}
910

1011
group = "org.springdoc"
@@ -50,6 +51,8 @@ dependencies {
5051
testImplementation(platform("org.junit:junit-bom:5.7.1"))
5152
testImplementation("org.junit.jupiter:junit-jupiter")
5253
testImplementation("com.beust:klaxon:5.5")
54+
55+
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0")
5356
}
5457

5558
gradlePlugin {
@@ -69,13 +72,23 @@ pluginBundle {
6972
tags = listOf("springdoc", "openapi", "swagger")
7073
}
7174

75+
val jvmVersion: JavaLanguageVersion = JavaLanguageVersion.of(8)
76+
7277
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
7378
kotlinOptions {
74-
jvmTarget = "1.8"
79+
jvmTarget = "1.${jvmVersion.toString()}"
7580
}
7681
}
7782

7883
tasks.withType<Test>().configureEach {
7984
useJUnitPlatform()
8085
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
8186
}
87+
88+
detekt {
89+
config = files("config/detekt/detekt.yml")
90+
parallel = true
91+
}
92+
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
93+
jvmTarget = "1.${jvmVersion.toString()}"
94+
}

0 commit comments

Comments
 (0)