Drop else after an early-exit if branch
ProprietaryWhen the if body ends in return, raise, continue or break, remove the else and dedent its contents. An else whose line, or the line before it, ends in a comment is left alone, as is an elif.
org. openrewrite. python. cleanup. RemoveUnnecessaryElsemod run . --recipe= org. openrewrite. python. cleanup. RemoveUnnecessaryElseInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.