Swap not all()/not any() by negating the comparison

Proprietary

Apply De Morgan's law to replace not all(cond ...) with any(negated_cond ...) or not any(cond ...) with all(negated_cond ...). An ordering such as x < y is only negated where both operands' types resolve to int, bool or str, a chained comparison is left alone, and any and all must resolve to the builtins.

org.openrewrite.python.cleanup.InvertAnyAll
mod run . --recipe=org.openrewrite.python.cleanup.InvertAnyAll

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