Find when with two or more branches having identical bodies

Proprietary

when (x) { A -> f(); B -> f() } repeats the same body for distinct labels — collapse to a single branch with comma-separated labels: A, B -> f().

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