Compare to None with identity operators (is / is not)

Proprietary

Switch == None to is None and != None to is not None, following PEP 8 singleton comparison guidance. Only fires where the operand's type resolves to a builtin. Other operands are left alone, since their __eq__ may give == None another meaning. A comparison holding comments is left alone.

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

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