KMP-NativeCoroutines icon indicating copy to clipboard operation
KMP-NativeCoroutines copied to clipboard

Detekt rule for detecting suspend functions and flows declarations, exposed to Obj-C

Open Pschsch opened this issue 2 years ago • 4 comments

Would be useful for teams who use this so popular analyzer

Pschsch avatar Sep 16 '23 08:09 Pschsch

As of version 1.0.0-ALPHA-16, such checks are built into the compiler plugin. Together with the IDE plugin those warnings (or errors) are also shown in the IDE.

What would be the added benefit of a Detekt rule?

rickclephas avatar Sep 16 '23 08:09 rickclephas

I've also seen this warning but I've ignored it. What's the proper way to fix this?

vanniktech avatar Sep 16 '23 11:09 vanniktech

@vanniktech you can either ignore specific declarations explicitly, or you can disable the check altogether.

rickclephas avatar Sep 16 '23 11:09 rickclephas

We want to throw an error if suspend and flow exposed to obj-c without plugin to clean up domain layer, because we want apply plugin only on ViewModel layer. With detekt we could achieve this automatically to avoid manual validating. As the alternative, kmp-native-coroutines plugin could provide plugin extension with flow declarations exposing compiler error level: warning or error. What do you think about this way?

Pschsch avatar Sep 20 '23 11:09 Pschsch