---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
F523.py:2:1: F523 [*] `.format` call has unused arguments at position(s): 1
  |
1 | # With indexes
2 | "{0}".format(1, 2)  # F523
  | ^^^^^^^^^^^^^^^^^^ 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

ℹ Safe fix
1 1 | # With indexes
2   |-"{0}".format(1, 2)  # F523
  2 |+"{0}".format(1, )  # F523
3 3 | "{1}".format(1, 2, 3)  # F523
4 4 | "{1:{0}}".format(1, 2)  # No issues
5 5 | "{1:{0}}".format(1, 2, 3)  # F523

F523.py:3:1: F523 `.format` call has unused arguments at position(s): 0, 2
  |
1 | # With indexes
2 | "{0}".format(1, 2)  # F523
3 | "{1}".format(1, 2, 3)  # F523
  | ^^^^^^^^^^^^^^^^^^^^^ 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.py:5:1: F523 [*] `.format` call has unused arguments at position(s): 2
  |
3 | "{1}".format(1, 2, 3)  # F523
4 | "{1:{0}}".format(1, 2)  # No issues
5 | "{1:{0}}".format(1, 2, 3)  # F523
  | ^^^^^^^^^^^^^^^^^^^^^^^^^ 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

ℹ Safe fix
2 2 | "{0}".format(1, 2)  # F523
3 3 | "{1}".format(1, 2, 3)  # F523
4 4 | "{1:{0}}".format(1, 2)  # No issues
5   |-"{1:{0}}".format(1, 2, 3)  # F523
  5 |+"{1:{0}}".format(1, 2, )  # F523
6 6 | "{0}{2}".format(1, 2)  # F523, # F524
7 7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
8 8 | 

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

ℹ Safe fix
3 3 | "{1}".format(1, 2, 3)  # F523
4 4 | "{1:{0}}".format(1, 2)  # No issues
5 5 | "{1:{0}}".format(1, 2, 3)  # F523
6   |-"{0}{2}".format(1, 2)  # F523, # F524
  6 |+"{0}{2}".format(1, )  # F523, # F524
7 7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
8 8 | 
9 9 | # With no indexes

F523.py:7:1: F523 `.format` call has unused arguments at position(s): 0, 3
  |
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
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
8 |
9 | # With no indexes
  |
  = help: Remove extra positional arguments at position(s): 0, 3

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

ℹ Safe fix
7  7  | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
8  8  | 
9  9  | # With no indexes
10    |-"{}".format(1, 2)  # F523
   10 |+"{}".format(1, )  # F523
11 11 | "{}".format(1, 2, 3)  # F523
12 12 | "{:{}}".format(1, 2)  # No issues
13 13 | "{:{}}".format(1, 2, 3)  # F523

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

ℹ Safe fix
8  8  | 
9  9  | # With no indexes
10 10 | "{}".format(1, 2)  # F523
11    |-"{}".format(1, 2, 3)  # F523
   11 |+"{}".format(1, )  # F523
12 12 | "{:{}}".format(1, 2)  # No issues
13 13 | "{:{}}".format(1, 2, 3)  # F523
14 14 | 

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

ℹ Safe fix
10 10 | "{}".format(1, 2)  # F523
11 11 | "{}".format(1, 2, 3)  # F523
12 12 | "{:{}}".format(1, 2)  # No issues
13    |-"{:{}}".format(1, 2, 3)  # F523
   13 |+"{:{}}".format(1, 2, )  # F523
14 14 | 
15 15 | # With *args
16 16 | "{0}{1}".format(*args)  # No issues

F523.py:19:1: F523 `.format` call has unused arguments at position(s): 2
   |
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
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
20 |
21 | # With nested quotes
   |
   = help: Remove extra positional arguments at position(s): 2

F523.py:22:1: F523 [*] `.format` call has unused arguments at position(s): 1, 2
   |
21 | # With nested quotes
22 | "''1{0}".format(1, 2, 3)  # F523
   | ^^^^^^^^^^^^^^^^^^^^^^^^ 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

ℹ Safe fix
19 19 | "{0}{1}".format(1, 2, 3, *args)  # F523
20 20 | 
21 21 | # With nested quotes
22    |-"''1{0}".format(1, 2, 3)  # F523
   22 |+"''1{0}".format(1, )  # F523
23 23 | "\"\"{1}{0}".format(1, 2, 3)  # F523
24 24 | '""{1}{0}'.format(1, 2, 3)  # F523
25 25 | 

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

ℹ Safe fix
20 20 | 
21 21 | # With nested quotes
22 22 | "''1{0}".format(1, 2, 3)  # F523
23    |-"\"\"{1}{0}".format(1, 2, 3)  # F523
   23 |+"\"\"{1}{0}".format(1, 2, )  # F523
24 24 | '""{1}{0}'.format(1, 2, 3)  # F523
25 25 | 
26 26 | # With modified indexes

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

ℹ Safe fix
21 21 | # With nested quotes
22 22 | "''1{0}".format(1, 2, 3)  # F523
23 23 | "\"\"{1}{0}".format(1, 2, 3)  # F523
24    |-'""{1}{0}'.format(1, 2, 3)  # F523
   24 |+'""{1}{0}'.format(1, 2, )  # F523
25 25 | 
26 26 | # With modified indexes
27 27 | "{1}{2}".format(1, 2, 3)  # F523, # F524

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

F523.py:29:1: F523 `.format` call has unused arguments at position(s): 0
   |
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
   | ^^^^^^^^^^^^^^^^^^^^^^ F523
30 |
31 | # Multiline
   |
   = help: Remove extra positional arguments at position(s): 0

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

ℹ Safe fix
29 29 | "{1} {8}".format(0, 1)  # F523, # F524
30 30 | 
31 31 | # Multiline
32    |-(''
33    |-.format(2))
   32 |+('')
34 33 | 
35 34 | # Removing the final argument.
36 35 | "Hello".format("world")

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

ℹ Safe fix
33 33 | .format(2))
34 34 | 
35 35 | # Removing the final argument.
36    |-"Hello".format("world")
   36 |+"Hello"
37 37 | "Hello".format("world", key="value")
38 38 | 
39 39 | # https://github.com/astral-sh/ruff/issues/18806

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

ℹ Safe fix
34 34 | 
35 35 | # Removing the final argument.
36 36 | "Hello".format("world")
37    |-"Hello".format("world", key="value")
   37 |+"Hello".format(key="value")
38 38 | 
39 39 | # https://github.com/astral-sh/ruff/issues/18806
40 40 | # The fix here is unsafe because the unused argument has side effect

F523.py:41:1: F523 [*] `.format` call has unused arguments at position(s): 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))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
42 |
43 | # The fix here is safe because the unused argument has no side effect,
   |
   = help: Remove extra positional arguments at position(s): 1

ℹ Unsafe fix
38 38 | 
39 39 | # https://github.com/astral-sh/ruff/issues/18806
40 40 | # The fix here is unsafe because the unused argument has side effect
41    |-"Hello, {0}".format("world", print(1))
   41 |+"Hello, {0}".format("world", )
42 42 | 
43 43 | # The fix here is safe because the unused argument has no side effect,
44 44 | # even though the used argument has a side effect

F523.py:45:1: F523 [*] `.format` call has unused arguments at position(s): 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")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
   |
   = help: Remove extra positional arguments at position(s): 1

ℹ Safe fix
42 42 | 
43 43 | # The fix here is safe because the unused argument has no side effect,
44 44 | # even though the used argument has a side effect
45    |-"Hello, {0}".format(print(1), "Pikachu")
   45 |+"Hello, {0}".format(print(1), )
