Hi! Do you have a KMM project with detekt configur...
# detekt
b
Hi! Do you have a KMM project with detekt configured on github? (I mean, open source) I'm starting with KMM and I'm not sure if I'm failing on the gradle part, on the detekt configuration or it is just that the experimental support of detekt for KMM is not working in this case.
h
This is my playground project, but only with a very basic detekt usage: https://github.com/hfhbd/ComposeTodo/blob/main/build.gradle.kts
❤️ 1
r
The main "aha" for me was to realize I needed to add the detekt plugins dependency outside the
kotlin.sourceSets
structure i.e. put the
Copy code
dependencies {
  detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.19.0")
}
bit at the top-level of the build (also where the
detekt
block goes of course).
👍 1
And also a lot of the paths in the rules file need changing to list out all the platform-specific sources.
Oh, and the detekt block needs the platform sources listed e.g.:
source = files("src/jsMain/kotlin", "src/jvmMain/kotlin", ...)
l
I’ve put this on pause until compose supports iOS, but I created https://github.com/LandryNorris/MemorizePi using detekt and kover.
❤️ 1
421 Views