Replace len() emptiness check with truthiness

Proprietary

Rewrite 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.SimplifyLenComparison
mod run . --recipe=org.openrewrite.python.cleanup.SimplifyLenComparison

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.