Find bitwise inversion ~ on a bool

Proprietary

Bitwise inversion of a bool (~True is -2) was deprecated in Python 3.12 and is scheduled for removal in Python 3.16. Use not x for logical negation, or ~int(x) for the integer inversion. Only fires on a bool literal or where the operand's type resolves to bool.

org.openrewrite.python.migrate.FindBitwiseInversionOnBool
mod run . --recipe=org.openrewrite.python.migrate.FindBitwiseInversionOnBool

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