chore: hideout-mastodonにDetektを追加

This commit is contained in:
usbharu 2024-08-23 23:51:25 +09:00
parent fd0d6b9625
commit da1235f95c
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 34 additions and 0 deletions

View File

@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.openapi.generator)
alias(libs.plugins.spring.boot)
alias(libs.plugins.kotlin.spring)
alias(libs.plugins.detekt)
}
@ -48,6 +49,7 @@ configurations {
}
dependencies {
detektPlugins(libs.detekt.formatting)
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
@ -115,3 +117,35 @@ sourceSets.main {
)
}
detekt {
parallel = true
config.setFrom(files("../detekt.yml"))
buildUponDefaultConfig = true
basePath = "${rootDir.absolutePath}/src/main/kotlin"
autoCorrect = true
}
configurations.matching { it.name == "detekt" }.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
useVersion(io.gitlab.arturbosch.detekt.getSupportedKotlinVersion())
}
}
}
tasks.withType<io.gitlab.arturbosch.detekt.Detekt> {
exclude("**/generated/**")
doFirst {
}
setSource("src/main/kotlin")
exclude("build/")
}
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
exclude("**/org/koin/ksp/generated/**", "**/generated/**")
}
tasks.withType<io.gitlab.arturbosch.detekt.DetektCreateBaselineTask>().configureEach {
exclude("**/org/koin/ksp/generated/**", "**/generated/**")
}