Hello team, I'm trying to write some custom rule o...
# detekt
x
Hello team, I'm trying to write some custom rule on a KMM project, and my rule needs type resolution. When I run it againt the jvm source set (calling
./gradlew :detektJvmMain
), my rule does have the type resolution and behaves as expected, but against the common source set (calling
./gradlew :detektMetadataMain
), the
bindingContext
is always null. Is this expected, or is there a way to have a binding context against non jvm sources?
b
Right now there is no way to make that.
And I think that Metadata will never be able to have binging information. The binding information comes from a compilation and common itself can't be compiles against "the void". Maybe we can do something else with k2, and their new apis but as far as I know no one checked that yet.
x
Interesting, and is there a way to have the commonMain source sets checked when running detekt on jvmMain for example ?
b
🤔 Good point. I must say that I never used detekt multiplatform. I was assuming that the errors on common would be raised on every single task. If that's not the case maybe an issue should be opened with your use case at see how to fix it.
x
That's not the case indeed, calling detektJvmMain only runs against the kotlin files in the jvmMain source set
I'll open an issue on github 😉
❤️ 1
e
@Xavier F. Gouchet did you end up opening an issue for it? If not I can open one.
x
Hey, Eliezer, sorry I got side tracked, but yeah you can open it 🙂
Eventually came around to do it here