diff --git a/crates/ruff/src/checkers/ast/analyze/expression.rs b/crates/ruff/src/checkers/ast/analyze/expression.rs index bd4a6f7e06..9d5e0d5a3d 100644 --- a/crates/ruff/src/checkers/ast/analyze/expression.rs +++ b/crates/ruff/src/checkers/ast/analyze/expression.rs @@ -341,6 +341,8 @@ pub(crate) fn expression(expr: &Expr, checker: &mut Checker) { }, ) => { if checker.any_enabled(&[ + // pylint + Rule::BadStringFormatCharacter, // pyflakes Rule::StringDotFormatInvalidFormat, Rule::StringDotFormatExtraNamedArguments, diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1300_bad_string_format_character.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1300_bad_string_format_character.py.snap index fc8bb36435..375d02e9e9 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1300_bad_string_format_character.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1300_bad_string_format_character.py.snap @@ -41,4 +41,14 @@ bad_string_format_character.py:11:1: PLE1300 Unsupported format character 'z' 13 | ## New style formatting | +bad_string_format_character.py:15:1: PLE1300 Unsupported format character 'y' + | +13 | ## New style formatting +14 | +15 | "{:s} {:y}".format("hello", "world") # [bad-format-character] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1300 +16 | +17 | "{:*^30s}".format("centered") + | +