---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
 --> F50x.py:5:1
  |
3 | '%(foo)s %s' % {'foo': 'bar'}  # F506
4 | '%j' % (1,)  # F509
5 | '%s %s' % (1,)  # F507
  | ^^^^^^^^^^^^^^
6 | '%s %s' % (1, 2, 3)  # F507
7 | '%(bar)s' % {}  # F505
  |

F507 `%`-format string has 2 placeholder(s) but 3 substitution(s)
 --> F50x.py:6:1
  |
4 | '%j' % (1,)  # F509
5 | '%s %s' % (1,)  # F507
6 | '%s %s' % (1, 2, 3)  # F507
  | ^^^^^^^^^^^^^^^^^^^
7 | '%(bar)s' % {}  # F505
8 | '%(bar)s' % {'bar': 1, 'baz': 2}  # F504
  |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:10:1
   |
 8 | '%(bar)s' % {'bar': 1, 'baz': 2}  # F504
 9 | '%(bar)s' % (1, 2, 3)  # F502
10 | '%s %s' % {'k': 'v'}  # F503
   | ^^^^^^^^^^^^^^^^^^^^
11 | '%(bar)*s' % {'bar': 'baz'}  # F506, F508
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:22:1
   |
20 | # ok *args and **kwargs
21 | a = []
22 | '%s %s' % [*a]
   | ^^^^^^^^^^^^^^
23 | '%s %s' % (*a,)
24 | k = {}
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:29:1
   |
27 | '%s' % {1, 2, 3}
28 | # F507: literal non-tuple RHS with multiple positional placeholders
29 | '%s %s' % 42  # F507
   | ^^^^^^^^^^^^
30 | '%s %s' % 3.14  # F507
31 | '%s %s' % "hello"  # F507
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:30:1
   |
28 | # F507: literal non-tuple RHS with multiple positional placeholders
29 | '%s %s' % 42  # F507
30 | '%s %s' % 3.14  # F507
   | ^^^^^^^^^^^^^^
31 | '%s %s' % "hello"  # F507
32 | '%s %s' % b"hello"  # F507
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:31:1
   |
29 | '%s %s' % 42  # F507
30 | '%s %s' % 3.14  # F507
31 | '%s %s' % "hello"  # F507
   | ^^^^^^^^^^^^^^^^^
32 | '%s %s' % b"hello"  # F507
33 | '%s %s' % True  # F507
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:32:1
   |
30 | '%s %s' % 3.14  # F507
31 | '%s %s' % "hello"  # F507
32 | '%s %s' % b"hello"  # F507
   | ^^^^^^^^^^^^^^^^^^
33 | '%s %s' % True  # F507
34 | '%s %s' % None  # F507
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:33:1
   |
31 | '%s %s' % "hello"  # F507
32 | '%s %s' % b"hello"  # F507
33 | '%s %s' % True  # F507
   | ^^^^^^^^^^^^^^
34 | '%s %s' % None  # F507
35 | '%s %s' % ...  # F507
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:34:1
   |
32 | '%s %s' % b"hello"  # F507
33 | '%s %s' % True  # F507
34 | '%s %s' % None  # F507
   | ^^^^^^^^^^^^^^
35 | '%s %s' % ...  # F507
36 | '%s %s' % f"hello {name}"  # F507
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:35:1
   |
33 | '%s %s' % True  # F507
34 | '%s %s' % None  # F507
35 | '%s %s' % ...  # F507
   | ^^^^^^^^^^^^^
36 | '%s %s' % f"hello {name}"  # F507
37 | # F507: ResolvedPythonType catches compound expressions with known types
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:36:1
   |
34 | '%s %s' % None  # F507
35 | '%s %s' % ...  # F507
36 | '%s %s' % f"hello {name}"  # F507
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
37 | # F507: ResolvedPythonType catches compound expressions with known types
38 | '%s %s' % -1  # F507 (unary op on int → int)
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:38:1
   |
36 | '%s %s' % f"hello {name}"  # F507
37 | # F507: ResolvedPythonType catches compound expressions with known types
38 | '%s %s' % -1  # F507 (unary op on int → int)
   | ^^^^^^^^^^^^
39 | '%s %s' % (1 + 2)  # F507 (int + int → int)
40 | '%s %s' % (not x)  # F507 (not → bool)
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:39:1
   |
37 | # F507: ResolvedPythonType catches compound expressions with known types
38 | '%s %s' % -1  # F507 (unary op on int → int)
39 | '%s %s' % (1 + 2)  # F507 (int + int → int)
   | ^^^^^^^^^^^^^^^^^
40 | '%s %s' % (not x)  # F507 (not → bool)
41 | '%s %s' % ("a" + "b")  # F507 (str + str → str)
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:40:1
   |
38 | '%s %s' % -1  # F507 (unary op on int → int)
39 | '%s %s' % (1 + 2)  # F507 (int + int → int)
40 | '%s %s' % (not x)  # F507 (not → bool)
   | ^^^^^^^^^^^^^^^^^
41 | '%s %s' % ("a" + "b")  # F507 (str + str → str)
42 | '%s %s' % (1 if True else 2)  # F507 (int if ... else int → int)
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:41:1
   |
39 | '%s %s' % (1 + 2)  # F507 (int + int → int)
40 | '%s %s' % (not x)  # F507 (not → bool)
41 | '%s %s' % ("a" + "b")  # F507 (str + str → str)
   | ^^^^^^^^^^^^^^^^^^^^^
42 | '%s %s' % (1 if True else 2)  # F507 (int if ... else int → int)
43 | # ok: single placeholder with literal RHS
   |

F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
  --> F50x.py:42:1
   |
40 | '%s %s' % (not x)  # F507 (not → bool)
41 | '%s %s' % ("a" + "b")  # F507 (str + str → str)
42 | '%s %s' % (1 if True else 2)  # F507 (int if ... else int → int)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 | # ok: single placeholder with literal RHS
44 | '%s' % 42
   |

F507 `%`-format string has 0 placeholder(s) but 1 substitution(s)
  --> F50x.py:57:1
   |
56 | # F507: zero placeholders with literal non-tuple RHS
57 | 'hello' % 42  # F507
   | ^^^^^^^^^^^^
58 | '' % 42  # F507
59 | 'hello' % (1,)  # F507
   |

F507 `%`-format string has 0 placeholder(s) but 1 substitution(s)
  --> F50x.py:58:1
   |
56 | # F507: zero placeholders with literal non-tuple RHS
57 | 'hello' % 42  # F507
58 | '' % 42  # F507
   | ^^^^^^^
59 | 'hello' % (1,)  # F507
60 | # F507: zero placeholders with variable RHS (intentional use is very unlikely)
   |

F507 `%`-format string has 0 placeholder(s) but 1 substitution(s)
  --> F50x.py:59:1
   |
57 | 'hello' % 42  # F507
58 | '' % 42  # F507
59 | 'hello' % (1,)  # F507
   | ^^^^^^^^^^^^^^
60 | # F507: zero placeholders with variable RHS (intentional use is very unlikely)
61 | banana = 42
   |

F507 `%`-format string has 0 placeholder(s) but 1 substitution(s)
  --> F50x.py:62:1
   |
60 | # F507: zero placeholders with variable RHS (intentional use is very unlikely)
61 | banana = 42
62 | 'hello' % banana  # F507
   | ^^^^^^^^^^^^^^^^
63 | '' % banana  # F507
64 | 'hello' % unknown_var  # F507
   |

F507 `%`-format string has 0 placeholder(s) but 1 substitution(s)
  --> F50x.py:63:1
   |
61 | banana = 42
62 | 'hello' % banana  # F507
63 | '' % banana  # F507
   | ^^^^^^^^^^^
64 | 'hello' % unknown_var  # F507
65 | 'hello' % get_value()  # F507
   |

F507 `%`-format string has 0 placeholder(s) but 1 substitution(s)
  --> F50x.py:64:1
   |
62 | 'hello' % banana  # F507
63 | '' % banana  # F507
64 | 'hello' % unknown_var  # F507
   | ^^^^^^^^^^^^^^^^^^^^^
65 | 'hello' % get_value()  # F507
66 | 'hello' % obj.attr  # F507
   |

F507 `%`-format string has 0 placeholder(s) but 1 substitution(s)
  --> F50x.py:65:1
   |
63 | '' % banana  # F507
64 | 'hello' % unknown_var  # F507
65 | 'hello' % get_value()  # F507
   | ^^^^^^^^^^^^^^^^^^^^^
66 | 'hello' % obj.attr  # F507
67 | # ok: zero placeholders with empty tuple
   |

F507 `%`-format string has 0 placeholder(s) but 1 substitution(s)
  --> F50x.py:66:1
   |
64 | 'hello' % unknown_var  # F507
65 | 'hello' % get_value()  # F507
66 | 'hello' % obj.attr  # F507
   | ^^^^^^^^^^^^^^^^^^
67 | # ok: zero placeholders with empty tuple
68 | 'hello' % ()
   |
