Modernize Kotlin functional / Result ergonomics

Proprietary

Search-only recipes that surface kotlin.Result / runCatching { } smells and try/catch shapes that map cleanly to Kotlin idioms (.fold(...), .getOrNull(), .getOrDefault(...), ?:, ?.let { }, requireNotNull, checkNotNull). Most of the actual rewrites involve moving statements between try-body / catch-body / Result-chain shapes, which the declarative rewrite { } to { } DSL doesn't model yet — so each match is a SearchResult for human review.

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

Recipe list

It runs these recipes, in this order.

  1. Find runCatching { } smells
  2. Find raw try/catch smells
  3. Find Result<T> API ergonomics opportunities
  4. Find throw/catch shape smells
  5. Find nullability idiom opportunities