Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Add Detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
mfvanek committed Apr 30, 2024
1 parent 233459b commit 5e23f5d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
performance:
SpreadOperator:
active: false
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pitest-junit5Plugin = "1.2.1"
pitest-core = "1.15.3"
pg-index-health = "0.10.3"
commons-lang3 = "3.14.0"
detekt = "1.23.6"

[libraries]
junit-bom = "org.junit:junit-bom:5.10.2"
Expand All @@ -22,7 +23,9 @@ pg-index-health-jdbcConnection = { group = "io.github.mfvanek", name = "pg-index
pg-index-health-generator = { group = "io.github.mfvanek", name = "pg-index-health-generator", version.ref = "pg-index-health" }
pg-index-health-testing = { group = "io.github.mfvanek", name = "pg-index-health-testing", version.ref = "pg-index-health" }
testcontainers-bom = { group = "org.testcontainers", name = "testcontainers-bom", version = "1.19.7" }
detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }

[plugins]
spring-boot-gradlePlugin = { id = "org.springframework.boot", version.ref = "spring-boot" }
spring-dependency-management = { id = "io.spring.dependency-management", version = "1.1.4" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
17 changes: 17 additions & 0 deletions kotlin-demo-app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -6,6 +7,7 @@ plugins {
id("pg-index-health-test-starter.java-compilation")
alias(libs.plugins.spring.boot.gradlePlugin)
alias(libs.plugins.spring.dependency.management)
alias(libs.plugins.detekt)
}

ext["commons-lang3.version"] = libs.versions.commons.lang3.get()
Expand All @@ -22,6 +24,8 @@ dependencies {

testImplementation(libs.spring.boot.starter.test)
testImplementation(libs.assertj.core)

detektPlugins(libs.detekt.formatting)
}

tasks.withType<KotlinCompile> {
Expand All @@ -30,3 +34,16 @@ tasks.withType<KotlinCompile> {
jvmTarget = "11"
}
}

detekt {
toolVersion = libs.versions.detekt.get()
config.setFrom(file("../config/detekt/detekt.yml"))
buildUponDefaultConfig = true
}

tasks.withType<Detekt>().configureEach {
reports {
xml.required.set(true)
html.required.set(true)
}
}

0 comments on commit 5e23f5d

Please sign in to comment.