Find suspend fun declarations returning Job / Deferred

Proprietary

A suspend fun foo(): Job is almost always a confusion of two patterns — either the function should suspend and return a value (drop the Job/Deferred), or it should launch and return the handle (drop suspend, and call coroutineScope { launch { … } } internally).

org.openrewrite.kotlin.bestpractices.FindSuspendFunctionReturningJob$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.bestpractices.FindSuspendFunctionReturningJob$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.