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

Commit

Permalink
feat(build): remove Detekt
Browse files Browse the repository at this point in the history
This no longer adds value for me and instead results in unnecessary
bikeshedding.
  • Loading branch information
msfjarvis committed Apr 27, 2023
1 parent 2b2c086 commit f0ac9f9
Show file tree
Hide file tree
Showing 15 changed files with 4 additions and 923 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ jobs:
name: Build report
path: build/reports/kotlin-build/

detekt:
lint:
needs: [ "check-changed-files" ]
runs-on: ubuntu-latest
steps:
Expand All @@ -212,10 +212,10 @@ jobs:
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Run detekt
- name: Run Lint
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
with:
arguments: detekt
arguments: lint
gradle-home-cache-cleanup: true

- name: Upload Kotlin build report
Expand Down
1 change: 0 additions & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ gradlePlugin {
dependencies {
implementation(platform(libs.kotlin.bom))
implementation(libs.build.agp)
implementation(libs.build.detekt)
implementation(libs.build.diffutils)
implementation(libs.build.download)
implementation(libs.build.kotlin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@

package app.passwordstore.gradle

import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.withType
import org.gradle.language.base.plugins.LifecycleBasePlugin
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand All @@ -25,22 +21,7 @@ class KotlinCommonPlugin : Plugin<Project> {

override fun apply(project: Project) {
val isAppModule = project.pluginManager.hasPlugin("com.android.application")
project.pluginManager.apply(DetektPlugin::class.java)
project.extensions.configure<DetektExtension> {
parallel = true
ignoredBuildTypes = listOf("release")
ignoredFlavors = listOf("free")
basePath = project.layout.projectDirectory.toString()
baseline =
project.rootProject.layout.projectDirectory
.dir("detekt-baselines")
.file("${project.name}.xml")
.asFile
}
project.tasks.run {
project.pluginManager.withPlugin("base") {
named(LifecycleBasePlugin.CHECK_TASK_NAME).configure { this.dependsOn(named("detekt")) }
}
withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
Expand Down
Loading

0 comments on commit f0ac9f9

Please sign in to comment.