[Python] How to make ruff to use f-string instead str.format?

Discussão em 'Python' iniciado por Stack, Julho 24, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying ruff but when I do ruff check . on my example:

    print("%s" % "hello")


    it shows:

    UP031 Use format specifiers instead of percent format


    and if I do ruff check . --fix or ruff format . they don't change anything.

    My pyproject.toml snipped:

    [tool.ruff]
    target-version = "py39"
    line-length = 120
    extend-select = ["E501", "UP", "RUF"]

    Continue reading...

Compartilhe esta Página