From 3d43c224856823a7bd426b95c402a4e408165114 Mon Sep 17 00:00:00 2001 From: Alberto Montes Date: Thu, 19 Sep 2024 22:16:40 +0200 Subject: [PATCH] Update tooling configuration to enforce f-string formatting (#125989) * Update tooling configuration to enforce f-string formatting * Disable the rule on Pylint as it is handled by ruff --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5fdbb91e434..bddb709ca03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -151,7 +151,6 @@ class-const-naming-style = "any" # inconsistent-return-statements - doesn't handle raise # too-many-ancestors - it's too strict. # wrong-import-order - isort guards this -# consider-using-f-string - str.format sometimes more readable # possibly-used-before-assignment - too many errors / not necessarily issues # --- # Pylint CodeStyle plugin @@ -174,7 +173,6 @@ disable = [ "too-many-public-methods", "too-many-boolean-expressions", "wrong-import-order", - "consider-using-f-string", "consider-using-namedtuple-or-dataclass", "consider-using-assignment-expr", "possibly-used-before-assignment", @@ -316,6 +314,7 @@ disable = [ "broad-except", # BLE001 "protected-access", # SLF001 "broad-exception-raised", # TRY002 + "consider-using-f-string", # PLC0209 # "no-self-use", # PLR6301 # Optional plugin, not enabled # Handled by mypy @@ -721,6 +720,7 @@ select = [ "DTZ004", # Use datetime.fromtimestamp(ts, tz=) instead of datetime.utcfromtimestamp(ts) "E", # pycodestyle "F", # pyflakes/autoflake + "F541", # f-string without any placeholders "FLY", # flynt "FURB", # refurb "G", # flake8-logging-format @@ -776,6 +776,8 @@ select = [ "TID251", # Banned imports "TRY", # tryceratops "UP", # pyupgrade + "UP031", # Use format specifiers instead of percent format + "UP032", # Use f-string instead of `format` call "W", # pycodestyle ]