Replace len() emptiness check with truthiness
ProprietaryRewrite len(seq) > 0, len(seq) != 0 and len(seq) >= 1 to seq and len(seq) == 0 to not seq. Only fires where the comparison is read as a truth value and the type of seq resolves to a builtin string, list, tuple, dict, set, frozenset, bytes or bytearray, whose truth value is its length.
org. openrewrite. python. cleanup. SimplifyLenComparisonmod run . --recipe= org. openrewrite. python. cleanup. SimplifyLenComparisonInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.