← All recipes
Moderne licensed

Replace % formatting with f-string

Recipe IDorg.openrewrite.python.migrate.ReplacePercentFormatWithFStringArtifactopenrewrite-migrate-python

Replace "..." % (...) expressions with f-strings (Python 3.6+). Only converts %s and %r specifiers where the format string is a literal and the conversion is safe.

Single recipepythonmigration3.6f-stringProprietary

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.migrate.ReplacePercentFormatWithFString

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

mod config recipes pip install openrewrite-migrate-python