From cace5cd2c9b896fad7631d1ecd45983d79823fac Mon Sep 17 00:00:00 2001 From: Zach Klippenstein Date: Tue, 18 May 2021 15:55:48 -0700 Subject: [PATCH] Remove Detekt from main and compose projects. This change was discussed and agreed upon in #420, since we don't get any value out of detekt and it makes maintaining our build scripts more difficult. --- .github/workflows/compose-kotlin.yml | 1 - .github/workflows/kotlin.yml | 2 +- build.gradle.kts | 5 ----- buildSrc/src/main/java/Dependencies.kt | 1 - compose/build.gradle.kts | 12 ----------- .../buildSrc/src/main/java/Dependencies.kt | 1 - compose/detekt.yml | 20 ------------------- versions.properties | 1 - 8 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 compose/detekt.yml diff --git a/.github/workflows/compose-kotlin.yml b/.github/workflows/compose-kotlin.yml index 13aafbe3b..8737f0243 100644 --- a/.github/workflows/compose-kotlin.yml +++ b/.github/workflows/compose-kotlin.yml @@ -76,7 +76,6 @@ jobs: - apiCheck - lint - ktlintCheck - - detekt steps: - uses: actions/checkout@v2 - name: set up JDK 11 diff --git a/.github/workflows/kotlin.yml b/.github/workflows/kotlin.yml index f60d3dd7a..be68b79c4 100644 --- a/.github/workflows/kotlin.yml +++ b/.github/workflows/kotlin.yml @@ -49,7 +49,7 @@ jobs: ## Actual task - name: Check with Gradle - run: ./gradlew test apiCheck lint ktlintCheck detekt jmhJar --no-daemon --stacktrace --continue + run: ./gradlew test apiCheck lint ktlintCheck jmhJar --no-daemon --stacktrace --continue # Decoder: # --continue: Run all checks, even if some fail. # test: unit tests diff --git a/build.gradle.kts b/build.gradle.kts index 72959298e..7cae9328a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,6 @@ import org.jlleitschuh.gradle.ktlint.reporter.ReporterType buildscript { dependencies { classpath(Dependencies.android_gradle_plugin) - classpath(Dependencies.detekt) classpath(Dependencies.dokka) classpath(Dependencies.Jmh.gradlePlugin) classpath(Dependencies.Kotlin.binaryCompatibilityValidatorPlugin) @@ -36,11 +35,7 @@ subprojects { } apply(plugin = "org.jlleitschuh.gradle.ktlint") - apply(plugin = "io.gitlab.arturbosch.detekt") afterEvaluate { - tasks.findByName("check") - ?.dependsOn("detekt") - // Can't use the normal placeholder syntax to reference the reflect version, since that // placeholder seems to only be evaluated if the module has a direct dependency on the library. val kotlinReflectVersion = File(rootDir, "versions.properties") diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 1b6908b64..01d36979f 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -106,7 +106,6 @@ object Dependencies { const val mavenPublish = "com.vanniktech:gradle-maven-publish-plugin:_" const val ktlint = "org.jlleitschuh.gradle:ktlint-gradle:_" const val lanterna = "com.googlecode.lanterna:lanterna:_" - const val detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:_" const val okio = "com.squareup.okio:okio:_" object RxJava2 { diff --git a/compose/build.gradle.kts b/compose/build.gradle.kts index 24495fddb..64cb7c9d9 100644 --- a/compose/build.gradle.kts +++ b/compose/build.gradle.kts @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import io.gitlab.arturbosch.detekt.extensions.DetektExtension import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jlleitschuh.gradle.ktlint.KtlintExtension import org.jlleitschuh.gradle.ktlint.reporter.ReporterType @@ -21,7 +20,6 @@ import org.jlleitschuh.gradle.ktlint.reporter.ReporterType buildscript { dependencies { classpath(Dependencies.android_gradle_plugin) - classpath(Dependencies.detekt) classpath(Dependencies.dokka) classpath(Dependencies.Kotlin.binaryCompatibilityValidatorPlugin) classpath(Dependencies.Kotlin.gradlePlugin) @@ -53,11 +51,7 @@ subprojects { } apply(plugin = "org.jlleitschuh.gradle.ktlint") - apply(plugin = "io.gitlab.arturbosch.detekt") afterEvaluate { - tasks.findByName("check") - ?.dependsOn("detekt") - configurations.configureEach { // There could be transitive dependencies in tests with a lower version. This could cause // problems with a newer Kotlin version that we use. @@ -106,12 +100,6 @@ subprojects { ) ) } - - configure { - config = files("${rootDir}/detekt.yml") - // Treat config file as an override for the default config. - buildUponDefaultConfig = true - } } apply(from = rootProject.file(".buildscript/binary-validation.gradle")) diff --git a/compose/buildSrc/src/main/java/Dependencies.kt b/compose/buildSrc/src/main/java/Dependencies.kt index 3b8d0ff6c..d75d85f1d 100644 --- a/compose/buildSrc/src/main/java/Dependencies.kt +++ b/compose/buildSrc/src/main/java/Dependencies.kt @@ -59,7 +59,6 @@ object Dependencies { const val dokka = "org.jetbrains.dokka:dokka-gradle-plugin:0.10.0" const val mavenPublish = "com.vanniktech:gradle-maven-publish-plugin:0.11.1" const val ktlint = "org.jlleitschuh.gradle:ktlint-gradle:9.2.0" - const val detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.1" object Test { object AndroidX { diff --git a/compose/detekt.yml b/compose/detekt.yml deleted file mode 100644 index 51dc86816..000000000 --- a/compose/detekt.yml +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright 2020 Square Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -naming: - MatchingDeclarationName: - active: false - FunctionNaming: - active: false diff --git a/versions.properties b/versions.properties index 6ec588810..5e2c0fb78 100644 --- a/versions.properties +++ b/versions.properties @@ -30,7 +30,6 @@ version.com.squareup..seismic=1.0.2 version.com.vanniktech..gradle-maven-publish-plugin=0.13.0 version.cycler=0.1.4 version.google.android.material=1.1.0 -version.io.gitlab.arturbosch.detekt..detekt-gradle-plugin=1.0.1 version.io.mockk..mockk=1.10.0 version.io.reactivex.rxjava2..rxandroid=2.1.1 version.io.reactivex.rxjava2..rxjava=2.2.19