plugins {
id("io.gitlab.arturbosch.detekt")
}
detekt {
// Bump this to receive new / adapted rules
toolVersion = "1.23.6"
val componentFile = rootProject.file("detekt.yml")
val globalFile = File(getGitRoot(), "detekt.yml")
require(componentFile.exists() || globalFile.exists()) { "No detekt.yml found" }
val configFile = if (componentFile.exists()) componentFile else globalFile
config.setFrom(configFile)
buildUponDefaultConfig = true
}
tasks.withType<Detekt>().configureEach {
// do not run detekt on generated files
exclude { spec ->
spec.file.absolutePath.contains("/build/")
}
reports {
// html and xml are by default on, we don't need txt
txt.required.set(false)
}
}
and this my detekt.yml which contains this configuration:
I have files underneath desktopMain and androidMain named PlatformUITest.desktop.kt and PlatformUITest.android.kt respectively. Still, Detekt does not acknowledge the configuration above nor does it work with the default set of multiplatformTargets out of the box:
> Task :app:detektMetadataCommonMain FAILED
Property 'naming>MatchingDeclarationName>multiplatformTargets' is misspelled or does not exist.
This is my detekt build convention:
and this my
detekt.yml
which contains this configuration:I have files underneath
desktopMain
andandroidMain
namedPlatformUITest.desktop.kt
andPlatformUITest.android.kt
respectively. Still, Detekt does not acknowledge the configuration above nor does it work with the default set of multiplatformTargets out of the box: