Simplify boolean literal comparisons
ProprietaryReplace x != True and x is not True with not x, and x == True and x is True with x where only the truth of the result is read. Only fires where x's type resolves to bool. A comparison against False is left alone, because x may be None where its type reads as bool, and None and False compare differently.
org. openrewrite. python. codequality. SimplifyBooleanLiteralmod run . --recipe= org. openrewrite. python. codequality. SimplifyBooleanLiteralInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.