Remove unconditional value overwrites
Recipe ID
org.openrewrite.python.codequality.RemoveUnconditionalValueOverwriteArtifactopenrewrite-migrate-pythonRemove consecutive assignments that write to the same dict key or object attribute, since the first value is immediately overwritten and never used. A write the second one can still observe -- by reading the target back, or through the object holding it -- is left alone.
Single recipepythonRSPEC-S4143code-qualityProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.python.codequality.RemoveUnconditionalValueOverwriteIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-migrate-python