Add missing enable check for bad-string-format-character (#6340)

This commit is contained in:
Charlie Marsh 2023-08-04 09:27:53 -04:00 committed by GitHub
parent f4831d5a26
commit 38a96c88c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -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,

View file

@ -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")
|