Skip to content

Commit

Permalink
引入detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
storytellerF committed Jan 29, 2024
1 parent 9e5438c commit bdb4daf
Show file tree
Hide file tree
Showing 57 changed files with 2,181 additions and 634 deletions.
36 changes: 36 additions & 0 deletions app/GiantExplorer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask

buildscript {
dependencies {
val versionManager: String by project
Expand All @@ -18,4 +21,37 @@ plugins {
id("org.jetbrains.kotlin.android") version kotlinVersion apply false
id("org.jetbrains.kotlin.jvm") version kotlinVersion apply false
id("com.google.devtools.ksp") version kspVersion apply false
id("io.gitlab.arturbosch.detekt") version "1.23.1"
}

subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
detekt {
source.setFrom(
io.gitlab.arturbosch.detekt.extensions.DetektExtension.DEFAULT_SRC_DIR_JAVA,
io.gitlab.arturbosch.detekt.extensions.DetektExtension.DEFAULT_TEST_SRC_DIR_JAVA,
io.gitlab.arturbosch.detekt.extensions.DetektExtension.DEFAULT_SRC_DIR_KOTLIN,
io.gitlab.arturbosch.detekt.extensions.DetektExtension.DEFAULT_TEST_SRC_DIR_KOTLIN,
)
buildUponDefaultConfig = true
autoCorrect = true
config.setFrom("$rootDir/config/detekt/detekt.yml")
baseline = file("$rootDir/config/detekt/baseline.xml")
}
dependencies {
val detektVersion = "1.23.1"

detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-rules-libraries:$detektVersion")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-rules-ruleauthors:$detektVersion")
}

tasks.withType<Detekt>().configureEach {
jvmTarget = "1.8"
basePath = rootDir.absolutePath
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = "1.8"
}

}
Loading

0 comments on commit bdb4daf

Please sign in to comment.