Strip dead code after terminal statements

Proprietary

Delete statements that follow a return, raise, continue, or break in the same block, since they can never execute. Dead code is kept where it holds a comment or a yield, or binds a name the function reads elsewhere, since either makes the function behave differently.

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

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