Strip str() from f-string placeholders

Proprietary

F-string placeholders convert values to strings automatically, so wrapping expressions in str() inside {...} is redundant. It only fires where str is the builtin and the wrapped value's type resolves to str, int, float or bool, and not with a format spec, since a placeholder formats with the value's own __format__.

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

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