Simplify boolean literal comparisons

Proprietary

Replace 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.SimplifyBooleanLiteral
mod run . --recipe=org.openrewrite.python.codequality.SimplifyBooleanLiteral

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