Find x.compareTo(y) <op> 0 patterns
Proprietaryx.compareTo(y) > 0 is the long form of x > y for any Comparable<T> — and >/</>=/<= are defined on Comparable to use exactly that call. The operator form reads as the comparison it is, and the bytecode emitted is identical.
org. openrewrite. kotlin. bestpractices. FindCompareToInsteadOfOperator$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. FindCompareToInsteadOfOperator$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.