---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
F523 [*] `.format` call has unused arguments at position(s): 1
 --> F523.py:2:1
  |
1 | # With indexes
2 | "{0}".format(1, 2)  # F523
  | ^^^^^^^^^^^^^^^^^^
3 | "{1}".format(1, 2, 3)  # F523
4 | "{1:{0}}".format(1, 2)  # No issues
  |
help: Remove extra positional arguments at position(s): 1
  |
1 | # With indexes
  - "{0}".format(1, 2)  # F523
2 + "{0}".format(1, )  # F523
3 | "{1}".format(1, 2, 3)  # F523
  |

F523 `.format` call has unused arguments at position(s): 0, 2
 --> F523.py:3:1
  |
1 | # With indexes
2 | "{0}".format(1, 2)  # F523
3 | "{1}".format(1, 2, 3)  # F523
  | ^^^^^^^^^^^^^^^^^^^^^
4 | "{1:{0}}".format(1, 2)  # No issues
5 | "{1:{0}}".format(1, 2, 3)  # F523
  |
help: Remove extra positional arguments at position(s): 0, 2

F523 [*] `.format` call has unused arguments at position(s): 2
 --> F523.py:5:1
  |
3 | "{1}".format(1, 2, 3)  # F523
4 | "{1:{0}}".format(1, 2)  # No issues
5 | "{1:{0}}".format(1, 2, 3)  # F523
  | ^^^^^^^^^^^^^^^^^^^^^^^^^
6 | "{0}{2}".format(1, 2)  # F523, # F524
7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
  |
help: Remove extra positional arguments at position(s): 2
  |
4 | "{1:{0}}".format(1, 2)  # No issues
  - "{1:{0}}".format(1, 2, 3)  # F523
5 + "{1:{0}}".format(1, 2, )  # F523
6 | "{0}{2}".format(1, 2)  # F523, # F524
  |

F523 [*] `.format` call has unused arguments at position(s): 1
 --> F523.py:6:1
  |
4 | "{1:{0}}".format(1, 2)  # No issues
5 | "{1:{0}}".format(1, 2, 3)  # F523
6 | "{0}{2}".format(1, 2)  # F523, # F524
  | ^^^^^^^^^^^^^^^^^^^^^
7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
  |
help: Remove extra positional arguments at position(s): 1
  |
5 | "{1:{0}}".format(1, 2, 3)  # F523
  - "{0}{2}".format(1, 2)  # F523, # F524
6 + "{0}{2}".format(1, )  # F523, # F524
7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
  |

F523 `.format` call has unused arguments at position(s): 0, 3
 --> F523.py:7:1
  |
5 | "{1:{0}}".format(1, 2, 3)  # F523
6 | "{0}{2}".format(1, 2)  # F523, # F524
7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 |
9 | # With no indexes
  |
help: Remove extra positional arguments at position(s): 0, 3

F523 [*] `.format` call has unused arguments at position(s): 1
  --> F523.py:10:1
   |
 9 | # With no indexes
10 | "{}".format(1, 2)  # F523
   | ^^^^^^^^^^^^^^^^^
11 | "{}".format(1, 2, 3)  # F523
12 | "{:{}}".format(1, 2)  # No issues
   |
help: Remove extra positional arguments at position(s): 1
   |
9  | # With no indexes
   - "{}".format(1, 2)  # F523
10 + "{}".format(1, )  # F523
11 | "{}".format(1, 2, 3)  # F523
   |

F523 [*] `.format` call has unused arguments at position(s): 1, 2
  --> F523.py:11:1
   |
 9 | # With no indexes
10 | "{}".format(1, 2)  # F523
11 | "{}".format(1, 2, 3)  # F523
   | ^^^^^^^^^^^^^^^^^^^^
12 | "{:{}}".format(1, 2)  # No issues
13 | "{:{}}".format(1, 2, 3)  # F523
   |
help: Remove extra positional arguments at position(s): 1, 2
   |
10 | "{}".format(1, 2)  # F523
   - "{}".format(1, 2, 3)  # F523
11 + "{}".format(1, )  # F523
12 | "{:{}}".format(1, 2)  # No issues
   |

F523 [*] `.format` call has unused arguments at position(s): 2
  --> F523.py:13:1
   |
11 | "{}".format(1, 2, 3)  # F523
12 | "{:{}}".format(1, 2)  # No issues
13 | "{:{}}".format(1, 2, 3)  # F523
   | ^^^^^^^^^^^^^^^^^^^^^^^
14 |
15 | # With *args
   |
help: Remove extra positional arguments at position(s): 2
   |
12 | "{:{}}".format(1, 2)  # No issues
   - "{:{}}".format(1, 2, 3)  # F523
13 + "{:{}}".format(1, 2, )  # F523
14 |
   |

F523 `.format` call has unused arguments at position(s): 2
  --> F523.py:19:1
   |
17 | "{0}{1}".format(1, *args)  # No issues
18 | "{0}{1}".format(1, 2, *args)  # No issues
19 | "{0}{1}".format(1, 2, 3, *args)  # F523
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 |
21 | # With nested quotes
   |
help: Remove extra positional arguments at position(s): 2

F523 [*] `.format` call has unused arguments at position(s): 1, 2
  --> F523.py:22:1
   |
21 | # With nested quotes
22 | "''1{0}".format(1, 2, 3)  # F523
   | ^^^^^^^^^^^^^^^^^^^^^^^^
23 | "\"\"{1}{0}".format(1, 2, 3)  # F523
24 | '""{1}{0}'.format(1, 2, 3)  # F523
   |
help: Remove extra positional arguments at position(s): 1, 2
   |
21 | # With nested quotes
   - "''1{0}".format(1, 2, 3)  # F523
22 + "''1{0}".format(1, )  # F523
23 | "\"\"{1}{0}".format(1, 2, 3)  # F523
   |

F523 [*] `.format` call has unused arguments at position(s): 2
  --> F523.py:23:1
   |
21 | # With nested quotes
22 | "''1{0}".format(1, 2, 3)  # F523
23 | "\"\"{1}{0}".format(1, 2, 3)  # F523
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 | '""{1}{0}'.format(1, 2, 3)  # F523
   |
help: Remove extra positional arguments at position(s): 2
   |
22 | "''1{0}".format(1, 2, 3)  # F523
   - "\"\"{1}{0}".format(1, 2, 3)  # F523
23 + "\"\"{1}{0}".format(1, 2, )  # F523
24 | '""{1}{0}'.format(1, 2, 3)  # F523
   |

F523 [*] `.format` call has unused arguments at position(s): 2
  --> F523.py:24:1
   |
22 | "''1{0}".format(1, 2, 3)  # F523
23 | "\"\"{1}{0}".format(1, 2, 3)  # F523
24 | '""{1}{0}'.format(1, 2, 3)  # F523
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
25 |
26 | # With modified indexes
   |
help: Remove extra positional arguments at position(s): 2
   |
23 | "\"\"{1}{0}".format(1, 2, 3)  # F523
   - '""{1}{0}'.format(1, 2, 3)  # F523
24 + '""{1}{0}'.format(1, 2, )  # F523
25 |
   |

F523 `.format` call has unused arguments at position(s): 0
  --> F523.py:27:1
   |
26 | # With modified indexes
27 | "{1}{2}".format(1, 2, 3)  # F523, # F524
   | ^^^^^^^^^^^^^^^^^^^^^^^^
28 | "{1}{3}".format(1, 2, 3, 4)  # F523, # F524
29 | "{1} {8}".format(0, 1)  # F523, # F524
   |
help: Remove extra positional arguments at position(s): 0

F523 `.format` call has unused arguments at position(s): 0, 2
  --> F523.py:28:1
   |
26 | # With modified indexes
27 | "{1}{2}".format(1, 2, 3)  # F523, # F524
28 | "{1}{3}".format(1, 2, 3, 4)  # F523, # F524
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 | "{1} {8}".format(0, 1)  # F523, # F524
   |
help: Remove extra positional arguments at position(s): 0, 2

F523 `.format` call has unused arguments at position(s): 0
  --> F523.py:29:1
   |
27 | "{1}{2}".format(1, 2, 3)  # F523, # F524
28 | "{1}{3}".format(1, 2, 3, 4)  # F523, # F524
29 | "{1} {8}".format(0, 1)  # F523, # F524
   | ^^^^^^^^^^^^^^^^^^^^^^
30 |
31 | # Multiline
   |
help: Remove extra positional arguments at position(s): 0

F523 [*] `.format` call has unused arguments at position(s): 0
  --> F523.py:32:2
   |
31 |   # Multiline
32 |   (''
   |  __^
33 | | .format(2))
   | |__________^
34 |
35 |   # Removing the final argument.
   |
help: Remove extra positional arguments at position(s): 0
   |
31 | # Multiline
   - (''
   - .format(2))
32 + ('')
33 |
   |

F523 [*] `.format` call has unused arguments at position(s): 0
  --> F523.py:36:1
   |
35 | # Removing the final argument.
36 | "Hello".format("world")
   | ^^^^^^^^^^^^^^^^^^^^^^^
37 | "Hello".format("world", key="value")
   |
help: Remove extra positional arguments at position(s): 0
   |
35 | # Removing the final argument.
   - "Hello".format("world")
36 + "Hello"
37 | "Hello".format("world", key="value")
   |

F523 [*] `.format` call has unused arguments at position(s): 0
  --> F523.py:37:1
   |
35 | # Removing the final argument.
36 | "Hello".format("world")
37 | "Hello".format("world", key="value")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 |
39 | # https://github.com/astral-sh/ruff/issues/18806
   |
help: Remove extra positional arguments at position(s): 0
   |
36 | "Hello".format("world")
   - "Hello".format("world", key="value")
37 + "Hello".format(key="value")
38 |
   |

F523 [*] `.format` call has unused arguments at position(s): 1
  --> F523.py:41:1
   |
39 | # https://github.com/astral-sh/ruff/issues/18806
40 | # The fix here is unsafe because the unused argument has side effect
41 | "Hello, {0}".format("world", print(1))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42 |
43 | # The fix here is safe because the unused argument has no side effect,
   |
help: Remove extra positional arguments at position(s): 1
   |
40 | # The fix here is unsafe because the unused argument has side effect
   - "Hello, {0}".format("world", print(1))
41 + "Hello, {0}".format("world", )
42 |
   |
note: This is an unsafe fix and may change runtime behavior

F523 [*] `.format` call has unused arguments at position(s): 1
  --> F523.py:45:1
   |
43 | # The fix here is safe because the unused argument has no side effect,
44 | # even though the used argument has a side effect
45 | "Hello, {0}".format(print(1), "Pikachu")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: Remove extra positional arguments at position(s): 1
   |
44 | # even though the used argument has a side effect
   - "Hello, {0}".format(print(1), "Pikachu")
45 + "Hello, {0}".format(print(1), )
   |
