← All recipes
Moderne licensed

Standardize instance method first parameter to self

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

Ensure instance methods use self as their first parameter per PEP 8 and rename all body references. Methods decorated with @staticmethod or @classmethod are not affected.

Single recipepythoncleanupnamingpep8Proprietary

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.InstanceMethodFirstArgName

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

mod config recipes pip install openrewrite-static-analysis