Find equality / comparison smells

Proprietary

=== / !== referential checks (usually == is meant), x == true|false longhand for Boolean, and x.compareTo(y) > 0 calls that should use the comparison operator directly.

org.openrewrite.kotlin.bestpractices.FindEqualitySmells$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.bestpractices.FindEqualitySmells$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 === / !== referential-equality comparisons
  2. Find b == true / b == false comparisons
  3. Find x.compareTo(y) <op> 0 patterns