Apply Kotlin null-safety and scope-function idioms

Proprietary

Search-only recipes covering the two most-cited stylistic categories in IntelliJ's Kotlin inspections: null-safety (if (x != null) ladders, !!, requireNotNull polish, mapNotNull / listOfNotNull adoption, unsafe casts) and scope-function ergonomics (the 12 well-defined let/run/with/apply/also correctness rules). Each match is a SearchResult for review — nothing is rewritten automatically.

org.openrewrite.kotlin.idiom.NullSafetyAndScopeFunctions$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.idiom.NullSafetyAndScopeFunctions$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 manual null-check idioms
  2. Find let { } ergonomics
  3. Find scope-function correctness swaps
  4. Find null-assertion polish opportunities
  5. Find collection null-safety idioms
  6. Find cast and nullable-shape idioms