From da1235f95c56e856f401dc14330620460246828f Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:51:25 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20hideout-mastodon=E3=81=ABDetekt?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hideout-mastodon/build.gradle.kts | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/hideout-mastodon/build.gradle.kts b/hideout-mastodon/build.gradle.kts index f9dbba9d..27da44bb 100644 --- a/hideout-mastodon/build.gradle.kts +++ b/hideout-mastodon/build.gradle.kts @@ -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 { + exclude("**/generated/**") + doFirst { + + } + setSource("src/main/kotlin") + exclude("build/") +} + +tasks.withType().configureEach { + exclude("**/org/koin/ksp/generated/**", "**/generated/**") +} + +tasks.withType().configureEach { + exclude("**/org/koin/ksp/generated/**", "**/generated/**") +} \ No newline at end of file