Find Modifier.padding(...) shorthand opportunities

Proprietary

Named-argument padding(...) calls whose values reduce to a shorter spelling: equal start/end + equal top/bottom collapses to padding(horizontal = x, vertical = y); all-equal collapses to padding(all = x); all-zero is a removable no-op.

org.openrewrite.kotlin.compose.FindModifierShorthands$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.compose.FindModifierShorthands$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 padding(start = x, end = x, top = y, bottom = y) shorthand opportunities
  2. Find padding(start = x, end = x, top = x, bottom = x) shorthand opportunities
  3. Find zero-valued Modifier.padding(...) calls