From a67549c7ed827ad063b866d181d87b7b054d4331 Mon Sep 17 00:00:00 2001 From: Jocelyne <38375996+joc-a@users.noreply.github.com> Date: Tue, 13 Feb 2024 13:04:12 +0200 Subject: [PATCH] chore: Configure detekt Gradle task to show its result in the terminal/IDE directly instead of generating an XML report (#1989) --- build.gradle.kts | 20 +++++-------------- .../org/jetbrains/exposed/gradle/Detekt.kt | 10 ---------- detekt/detekt-config.yml | 2 +- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cce6b5e83a..aa97291f25 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ -import io.gitlab.arturbosch.detekt.Detekt -import io.gitlab.arturbosch.detekt.report.ReportMergeTask -import org.jetbrains.exposed.gradle.* +import org.jetbrains.exposed.gradle.configureDetekt +import org.jetbrains.exposed.gradle.configurePublishing +import org.jetbrains.exposed.gradle.testDb plugins { kotlin("jvm") apply true @@ -15,8 +15,6 @@ repositories { } allprojects { - configureDetekt() - if (this.name != "exposed-tests" && this.name != "exposed-bom" && this != rootProject) { configurePublishing() } @@ -26,20 +24,12 @@ apiValidation { ignoredProjects.addAll(listOf("exposed-tests", "exposed-bom")) } -val reportMerge by tasks.registering(ReportMergeTask::class) { - output.set(rootProject.buildDir.resolve("reports/detekt/exposed.xml")) -} - subprojects { + configureDetekt() + dependencies { detektPlugins(rootProject.libs.detekt.formatting) } - tasks.withType().configureEach detekt@{ - finalizedBy(reportMerge) - reportMerge.configure { - input.from(this@detekt.xmlReportFile) - } - } } subprojects { diff --git a/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Detekt.kt b/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Detekt.kt index b358f69f7d..fd73ca294f 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Detekt.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Detekt.kt @@ -1,12 +1,10 @@ package org.jetbrains.exposed.gradle -import io.gitlab.arturbosch.detekt.Detekt import io.gitlab.arturbosch.detekt.DetektPlugin import io.gitlab.arturbosch.detekt.extensions.DetektExtension import org.gradle.api.Project import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.withType fun Project.configureDetekt() { apply() @@ -17,12 +15,4 @@ fun Project.configureDetekt() { parallel = true config.setFrom("$rootDir/detekt/detekt-config.yml") } - tasks.withType().configureEach { - reports { - xml.required.set(true) - html.required.set(false) - txt.required.set(false) - sarif.required.set(false) - } - } } diff --git a/detekt/detekt-config.yml b/detekt/detekt-config.yml index 081859acb1..eeff9591c9 100644 --- a/detekt/detekt-config.yml +++ b/detekt/detekt-config.yml @@ -1,7 +1,7 @@ # https://github.com/detekt/detekt/blob/main/detekt-core/src/main/resources/default-detekt-config.yml build: - maxIssues: 52 + maxIssues: 0 formatting: ArgumentListWrapping: