mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
cc09230e26
* Removing ktlint * Removing compose lint * Adding initial Detekt config * Setting up detekt config * Adding detekt baseline * Fixing workflows * Moving to a module based solution * Adding new line * Adding new line * Updating baseline * Addressing PR suggestions * Regenerating baseline.xml * Cleanup --------- Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
47 lines
1.3 KiB
Text
47 lines
1.3 KiB
Text
import io.gitlab.arturbosch.detekt.Detekt
|
|
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
|
|
import org.gradle.accessors.dm.LibrariesForLibs
|
|
|
|
plugins {
|
|
id("io.gitlab.arturbosch.detekt")
|
|
}
|
|
|
|
val libs = the<LibrariesForLibs>()
|
|
dependencies {
|
|
detektPlugins(libs.detekt.rules.formatting)
|
|
detektPlugins(libs.detekt.rules.compose)
|
|
}
|
|
|
|
private val configFile = files("$rootDir/config/detekt/detekt.yml")
|
|
private val baselineFile = file("$rootDir/config/detekt/baseline.xml")
|
|
private val kotlinFiles = "**/*.kt"
|
|
private val resourceFiles = "**/resources/**"
|
|
private val buildFiles = "**/build/**"
|
|
private val generatedFiles = "**/generated/**"
|
|
private val scriptsFiles = "**/*.kts"
|
|
|
|
detekt {
|
|
buildUponDefaultConfig = true
|
|
parallel = true
|
|
autoCorrect = false
|
|
ignoreFailures = false
|
|
config.setFrom(configFile)
|
|
baseline = file(baselineFile)
|
|
}
|
|
|
|
tasks.withType<Detekt>().configureEach {
|
|
include(kotlinFiles)
|
|
exclude(resourceFiles, buildFiles, generatedFiles, scriptsFiles)
|
|
reports {
|
|
html.required.set(true)
|
|
xml.required.set(false)
|
|
txt.required.set(false)
|
|
}
|
|
}
|
|
|
|
tasks.withType<Detekt>().configureEach {
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
}
|
|
tasks.withType<DetektCreateBaselineTask>().configureEach {
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
}
|