Remove conditional with identical branches
ProprietaryReplace if/elif/else chains where every branch has the same body with just the body, since the condition has no effect on what code executes. A chain whose conditions may have side effects, such as a call, or that holds comments outside its bodies is left alone.
org. openrewrite. python. codequality. AllBranchesIdenticalmod run . --recipe= org. openrewrite. python. codequality. AllBranchesIdenticalInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.