hi, I'm new to `checkModules` . As I understand it...
# koin
f
hi, I'm new to
checkModules
. As I understand it only checks if there are gaps inside the module graph. But if I try to check for a leaf of the graph it won't fail, such as forgetting to add a
factory { B() }
in the following case.
Copy code
class A : KoinComponent {
  val b : B by inject()
}
class B {
}
Is there any way to check for that too without having to write specific tests for specific classes? (which I may forget)
a
Hi @Fabio this kind of case is not yet really taken into account for now
checkModules will check against what is declared in modules
One idea here is to help with Kotlin Compiler plugin to analyse that at early stage of compilation
f
I guess the idea would be to scan all the files for
inject
and
get
?
a
something like that. Or while we type inject(), the compiler can verify you have declared the right component
f
oh that's intersting... I may give it a shot on the scan files after the fact, for a couple of reasons: I have a faint idea how to code it, and it would work on CI with my android projects that usually have flavors. but just being curious, how would you go on checking while typing? that would be super cool but involve writing an idea plugin, and my short experience with that is that it's very slow and undocumented
a
the key would be Kotlin compiler plugin
with Arrow Meta project
f
That's super interesting but it's a bigger bite than I can chew. I'll def read more on free time though.
a
yep, tricky side