Find forEach { it.toString() } patterns

Proprietary

it.toString() inside a forEach evaluates the call but discards the result — equivalent to forEach {}. Either the side effect on toString() is the goal (very unusual) or the call is dead code.

org.openrewrite.kotlin.bestpractices.FindRedundantToStringInForEach$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.bestpractices.FindRedundantToStringInForEach$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.