Remove unnecessary assignment before return

Proprietary

Return the value directly where a variable is assigned and then immediately returned. A name that appears anywhere else in the function, a yield value, and a comment before the return are left alone.

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

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