← All recipes
Moderne licensed

Deduplicate repeated elements in set literals

Recipe IDorg.openrewrite.python.cleanup.RemoveDuplicateSetKeyArtifactopenrewrite-static-analysis

Set literals with repeated values have redundant entries that are discarded at runtime. This removes the duplicates, keeping the last one.

Single recipeProprietary

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.cleanup.RemoveDuplicateSetKey

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-static-analysis