https://kotlinlang.org logo
#detekt
Title
# detekt
b

Brais Gabin

03/24/2022, 10:32 AM
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

hfhbd

03/24/2022, 10:55 AM
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

rocketraman

03/24/2022, 1:26 PM
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

Landry Norris

03/24/2022, 3:23 PM
I’ve put this on pause until compose supports iOS, but I created https://github.com/LandryNorris/MemorizePi using detekt and kover.
❤️ 1
181 Views