Eliminate boolean literal from and/or

Proprietary

Strip True or False from and/or expressions where the literal has no effect on the result, e.g. True and val reduces to val and False and val reduces to False. A literal on the right is dropped only from x and True and x or False, and only where the result is read as a truth value. x and False and x or True are left alone.

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

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