mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
Add missing enable check for bad-string-format-character (#6340)
This commit is contained in:
parent
f4831d5a26
commit
38a96c88c1
2 changed files with 12 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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")
|
||||
|
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue