---
source: crates/ruff/src/rules/pyupgrade/mod.rs
---
UP031_0.py:4:7: UP031 [*] Use format specifiers instead of percent format
  |
4 | # UP031
5 | print('%s %s' % (a, b))
  |       ^^^^^^^^^^^^^^^^ UP031
6 | 
7 | print('%s%s' % (a, b))
  |
  = help: Replace with format specifiers

ℹ Suggested fix
1 1 | a, b, x, y = 1, 2, 3, 4
2 2 | 
3 3 | # UP031
4   |-print('%s %s' % (a, b))
  4 |+print('{} {}'.format(a, b))
5 5 | 
6 6 | print('%s%s' % (a, b))
7 7 | 

UP031_0.py:6:7: UP031 [*] Use format specifiers instead of percent format
   |
 6 | print('%s %s' % (a, b))
 7 | 
 8 | print('%s%s' % (a, b))
   |       ^^^^^^^^^^^^^^^ UP031
 9 | 
10 | print("trivial" % ())
   |
   = help: Replace with format specifiers

ℹ Suggested fix
3 3 | # UP031
4 4 | print('%s %s' % (a, b))
5 5 | 
6   |-print('%s%s' % (a, b))
  6 |+print('{}{}'.format(a, b))
7 7 | 
8 8 | print("trivial" % ())
9 9 | 

UP031_0.py:8:7: UP031 [*] Use format specifiers instead of percent format
   |
 8 | print('%s%s' % (a, b))
 9 | 
10 | print("trivial" % ())
   |       ^^^^^^^^^^^^^^ UP031
11 | 
12 | print("%s" % ("simple",))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
5 5 | 
6 6 | print('%s%s' % (a, b))
7 7 | 
8   |-print("trivial" % ())
  8 |+print("trivial".format())
9 9 | 
10 10 | print("%s" % ("simple",))
11 11 | 

UP031_0.py:10:7: UP031 [*] Use format specifiers instead of percent format
   |
10 | print("trivial" % ())
11 | 
12 | print("%s" % ("simple",))
   |       ^^^^^^^^^^^^^^^^^^ UP031
13 | 
14 | print("%s" % ("%s" % ("nested",),))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
7  7  | 
8  8  | print("trivial" % ())
9  9  | 
10    |-print("%s" % ("simple",))
   10 |+print("{}".format("simple"))
11 11 | 
12 12 | print("%s" % ("%s" % ("nested",),))
13 13 | 

UP031_0.py:12:7: UP031 [*] Use format specifiers instead of percent format
   |
12 | print("%s" % ("simple",))
13 | 
14 | print("%s" % ("%s" % ("nested",),))
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
15 | 
16 | print("%s%% percent" % (15,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
9  9  | 
10 10 | print("%s" % ("simple",))
11 11 | 
12    |-print("%s" % ("%s" % ("nested",),))
   12 |+print("{}".format("%s" % ("nested",)))
13 13 | 
14 14 | print("%s%% percent" % (15,))
15 15 | 

UP031_0.py:12:15: UP031 [*] Use format specifiers instead of percent format
   |
12 | print("%s" % ("simple",))
13 | 
14 | print("%s" % ("%s" % ("nested",),))
   |               ^^^^^^^^^^^^^^^^^^ UP031
15 | 
16 | print("%s%% percent" % (15,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
9  9  | 
10 10 | print("%s" % ("simple",))
11 11 | 
12    |-print("%s" % ("%s" % ("nested",),))
   12 |+print("%s" % ("{}".format("nested"),))
13 13 | 
14 14 | print("%s%% percent" % (15,))
15 15 | 

UP031_0.py:14:7: UP031 [*] Use format specifiers instead of percent format
   |
14 | print("%s" % ("%s" % ("nested",),))
15 | 
16 | print("%s%% percent" % (15,))
   |       ^^^^^^^^^^^^^^^^^^^^^^ UP031
17 | 
18 | print("%f" % (15,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
11 11 | 
12 12 | print("%s" % ("%s" % ("nested",),))
13 13 | 
14    |-print("%s%% percent" % (15,))
   14 |+print("{}% percent".format(15))
15 15 | 
16 16 | print("%f" % (15,))
17 17 | 

UP031_0.py:16:7: UP031 [*] Use format specifiers instead of percent format
   |
16 | print("%s%% percent" % (15,))
17 | 
18 | print("%f" % (15,))
   |       ^^^^^^^^^^^^ UP031
19 | 
20 | print("%.f" % (15,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
13 13 | 
14 14 | print("%s%% percent" % (15,))
15 15 | 
16    |-print("%f" % (15,))
   16 |+print("{:f}".format(15))
17 17 | 
18 18 | print("%.f" % (15,))
19 19 | 

UP031_0.py:18:7: UP031 [*] Use format specifiers instead of percent format
   |
18 | print("%f" % (15,))
19 | 
20 | print("%.f" % (15,))
   |       ^^^^^^^^^^^^^ UP031
21 | 
22 | print("%.3f" % (15,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
15 15 | 
16 16 | print("%f" % (15,))
17 17 | 
18    |-print("%.f" % (15,))
   18 |+print("{:.0f}".format(15))
19 19 | 
20 20 | print("%.3f" % (15,))
21 21 | 

UP031_0.py:20:7: UP031 [*] Use format specifiers instead of percent format
   |
20 | print("%.f" % (15,))
21 | 
22 | print("%.3f" % (15,))
   |       ^^^^^^^^^^^^^^ UP031
23 | 
24 | print("%3f" % (15,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
17 17 | 
18 18 | print("%.f" % (15,))
19 19 | 
20    |-print("%.3f" % (15,))
   20 |+print("{:.3f}".format(15))
21 21 | 
22 22 | print("%3f" % (15,))
23 23 | 

UP031_0.py:22:7: UP031 [*] Use format specifiers instead of percent format
   |
22 | print("%.3f" % (15,))
23 | 
24 | print("%3f" % (15,))
   |       ^^^^^^^^^^^^^ UP031
25 | 
26 | print("%-5f" % (5,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
19 19 | 
20 20 | print("%.3f" % (15,))
21 21 | 
22    |-print("%3f" % (15,))
   22 |+print("{:3f}".format(15))
23 23 | 
24 24 | print("%-5f" % (5,))
25 25 | 

UP031_0.py:24:7: UP031 [*] Use format specifiers instead of percent format
   |
24 | print("%3f" % (15,))
25 | 
26 | print("%-5f" % (5,))
   |       ^^^^^^^^^^^^^ UP031
27 | 
28 | print("%9f" % (5,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
21 21 | 
22 22 | print("%3f" % (15,))
23 23 | 
24    |-print("%-5f" % (5,))
   24 |+print("{:<5f}".format(5))
25 25 | 
26 26 | print("%9f" % (5,))
27 27 | 

UP031_0.py:26:7: UP031 [*] Use format specifiers instead of percent format
   |
26 | print("%-5f" % (5,))
27 | 
28 | print("%9f" % (5,))
   |       ^^^^^^^^^^^^ UP031
29 | 
30 | print("%#o" % (123,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
23 23 | 
24 24 | print("%-5f" % (5,))
25 25 | 
26    |-print("%9f" % (5,))
   26 |+print("{:9f}".format(5))
27 27 | 
28 28 | print("%#o" % (123,))
29 29 | 

UP031_0.py:28:7: UP031 [*] Use format specifiers instead of percent format
   |
28 | print("%9f" % (5,))
29 | 
30 | print("%#o" % (123,))
   |       ^^^^^^^^^^^^^^ UP031
31 | 
32 | print("brace {} %s" % (1,))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
25 25 | 
26 26 | print("%9f" % (5,))
27 27 | 
28    |-print("%#o" % (123,))
   28 |+print("{:#o}".format(123))
29 29 | 
30 30 | print("brace {} %s" % (1,))
31 31 | 

UP031_0.py:30:7: UP031 [*] Use format specifiers instead of percent format
   |
30 | print("%#o" % (123,))
31 | 
32 | print("brace {} %s" % (1,))
   |       ^^^^^^^^^^^^^^^^^^^^ UP031
33 | 
34 | print(
   |
   = help: Replace with format specifiers

ℹ Suggested fix
27 27 | 
28 28 | print("%#o" % (123,))
29 29 | 
30    |-print("brace {} %s" % (1,))
   30 |+print("brace {{}} {}".format(1))
31 31 | 
32 32 | print(
33 33 |   "%s" % (

UP031_0.py:33:3: UP031 [*] Use format specifiers instead of percent format
   |
33 |   print(
34 |     "%s" % (
   |  ___^
35 | |     "trailing comma",
36 | |         )
   | |_________^ UP031
37 |   )
   |
   = help: Replace with format specifiers

ℹ Suggested fix
30 30 | print("brace {} %s" % (1,))
31 31 | 
32 32 | print(
33    |-  "%s" % (
   33 |+  "{}".format(
34 34 |     "trailing comma",
35 35 |         )
36 36 | )

UP031_0.py:38:7: UP031 [*] Use format specifiers instead of percent format
   |
38 | )
39 | 
40 | print("foo %s " % (x,))
   |       ^^^^^^^^^^^^^^^^ UP031
41 | 
42 | print("%(k)s" % {"k": "v"})
   |
   = help: Replace with format specifiers

ℹ Suggested fix
35 35 |         )
36 36 | )
37 37 | 
38    |-print("foo %s " % (x,))
   38 |+print("foo {} ".format(x))
39 39 | 
40 40 | print("%(k)s" % {"k": "v"})
41 41 | 

UP031_0.py:40:7: UP031 [*] Use format specifiers instead of percent format
   |
40 | print("foo %s " % (x,))
41 | 
42 | print("%(k)s" % {"k": "v"})
   |       ^^^^^^^^^^^^^^^^^^^^ UP031
43 | 
44 | print("%(k)s" % {
   |
   = help: Replace with format specifiers

ℹ Suggested fix
37 37 | 
38 38 | print("foo %s " % (x,))
39 39 | 
40    |-print("%(k)s" % {"k": "v"})
   40 |+print("{k}".format(k="v"))
41 41 | 
42 42 | print("%(k)s" % {
43 43 |     "k": "v",

UP031_0.py:42:7: UP031 [*] Use format specifiers instead of percent format
   |
42 |   print("%(k)s" % {"k": "v"})
43 |   
44 |   print("%(k)s" % {
   |  _______^
45 | |     "k": "v",
46 | |     "i": "j"
47 | | })
   | |_^ UP031
48 |   
49 |   print("%(to_list)s" % {"to_list": []})
   |
   = help: Replace with format specifiers

ℹ Suggested fix
39 39 | 
40 40 | print("%(k)s" % {"k": "v"})
41 41 | 
42    |-print("%(k)s" % {
43    |-    "k": "v",
44    |-    "i": "j"
45    |-})
   42 |+print("{k}".format(
   43 |+    k="v",
   44 |+    i="j",
   45 |+))
46 46 | 
47 47 | print("%(to_list)s" % {"to_list": []})
48 48 | 

UP031_0.py:47:7: UP031 [*] Use format specifiers instead of percent format
   |
47 | })
48 | 
49 | print("%(to_list)s" % {"to_list": []})
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
50 | 
51 | print("%(k)s" % {"k": "v", "i": 1, "j": []})
   |
   = help: Replace with format specifiers

ℹ Suggested fix
44 44 |     "i": "j"
45 45 | })
46 46 | 
47    |-print("%(to_list)s" % {"to_list": []})
   47 |+print("{to_list}".format(to_list=[]))
48 48 | 
49 49 | print("%(k)s" % {"k": "v", "i": 1, "j": []})
50 50 | 

UP031_0.py:49:7: UP031 [*] Use format specifiers instead of percent format
   |
49 | print("%(to_list)s" % {"to_list": []})
50 | 
51 | print("%(k)s" % {"k": "v", "i": 1, "j": []})
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
52 | 
53 | print("%(ab)s" % {"a" "b": 1})
   |
   = help: Replace with format specifiers

ℹ Suggested fix
46 46 | 
47 47 | print("%(to_list)s" % {"to_list": []})
48 48 | 
49    |-print("%(k)s" % {"k": "v", "i": 1, "j": []})
   49 |+print("{k}".format(k="v", i=1, j=[]))
50 50 | 
51 51 | print("%(ab)s" % {"a" "b": 1})
52 52 | 

UP031_0.py:51:7: UP031 [*] Use format specifiers instead of percent format
   |
51 | print("%(k)s" % {"k": "v", "i": 1, "j": []})
52 | 
53 | print("%(ab)s" % {"a" "b": 1})
   |       ^^^^^^^^^^^^^^^^^^^^^^^ UP031
54 | 
55 | print("%(a)s" % {"a"  :  1})
   |
   = help: Replace with format specifiers

ℹ Suggested fix
48 48 | 
49 49 | print("%(k)s" % {"k": "v", "i": 1, "j": []})
50 50 | 
51    |-print("%(ab)s" % {"a" "b": 1})
   51 |+print("{ab}".format(ab=1))
52 52 | 
53 53 | print("%(a)s" % {"a"  :  1})
54 54 | 

UP031_0.py:53:7: UP031 [*] Use format specifiers instead of percent format
   |
53 | print("%(ab)s" % {"a" "b": 1})
54 | 
55 | print("%(a)s" % {"a"  :  1})
   |       ^^^^^^^^^^^^^^^^^^^^^ UP031
56 | 
57 | print((
   |
   = help: Replace with format specifiers

ℹ Suggested fix
50 50 | 
51 51 | print("%(ab)s" % {"a" "b": 1})
52 52 | 
53    |-print("%(a)s" % {"a"  :  1})
   53 |+print("{a}".format(a=1))
54 54 | 
55 55 | print((
56 56 |     "foo %s "

UP031_0.py:56:5: UP031 [*] Use format specifiers instead of percent format
   |
56 |   print((
57 |       "foo %s "
   |  _____^
58 | |     "bar %s" % (x, y)
   | |_____________________^ UP031
59 |   ))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
53 53 | print("%(a)s" % {"a"  :  1})
54 54 | 
55 55 | print((
56    |-    "foo %s "
57    |-    "bar %s" % (x, y)
   56 |+    "foo {} "
   57 |+    "bar {}".format(x, y)
58 58 | ))
59 59 | 
60 60 | print(

UP031_0.py:61:5: UP031 [*] Use format specifiers instead of percent format
   |
61 |   print(
62 |       "foo %(foo)s "
   |  _____^
63 | |     "bar %(bar)s" % {"foo": x, "bar": y}
   | |________________________________________^ UP031
64 |   )
   |
   = help: Replace with format specifiers

ℹ Suggested fix
58 58 | ))
59 59 | 
60 60 | print(
61    |-    "foo %(foo)s "
62    |-    "bar %(bar)s" % {"foo": x, "bar": y}
   61 |+    "foo {foo} "
   62 |+    "bar {bar}".format(foo=x, bar=y)
63 63 | )
64 64 | 
65 65 | bar = {"bar": y}

UP031_0.py:67:5: UP031 [*] Use format specifiers instead of percent format
   |
67 |   bar = {"bar": y}
68 |   print(
69 |       "foo %(foo)s "
   |  _____^
70 | |     "bar %(bar)s" % {"foo": x, **bar}
   | |_____________________________________^ UP031
71 |   )
   |
   = help: Replace with format specifiers

ℹ Suggested fix
64 64 | 
65 65 | bar = {"bar": y}
66 66 | print(
67    |-    "foo %(foo)s "
68    |-    "bar %(bar)s" % {"foo": x, **bar}
   67 |+    "foo {foo} "
   68 |+    "bar {bar}".format(foo=x, **bar)
69 69 | )
70 70 | 
71 71 | print("%s \N{snowman}" % (a,))

UP031_0.py:71:7: UP031 [*] Use format specifiers instead of percent format
   |
71 | )
72 | 
73 | print("%s \N{snowman}" % (a,))
   |       ^^^^^^^^^^^^^^^^^^^^^^^ UP031
74 | 
75 | print("%(foo)s \N{snowman}" % {"foo": 1})
   |
   = help: Replace with format specifiers

ℹ Suggested fix
68 68 |     "bar %(bar)s" % {"foo": x, **bar}
69 69 | )
70 70 | 
71    |-print("%s \N{snowman}" % (a,))
   71 |+print("{} \N{snowman}".format(a))
72 72 | 
73 73 | print("%(foo)s \N{snowman}" % {"foo": 1})
74 74 | 

UP031_0.py:73:7: UP031 [*] Use format specifiers instead of percent format
   |
73 | print("%s \N{snowman}" % (a,))
74 | 
75 | print("%(foo)s \N{snowman}" % {"foo": 1})
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
76 | 
77 | print(("foo %s " "bar %s") % (x, y))
   |
   = help: Replace with format specifiers

ℹ Suggested fix
70 70 | 
71 71 | print("%s \N{snowman}" % (a,))
72 72 | 
73    |-print("%(foo)s \N{snowman}" % {"foo": 1})
   73 |+print("{foo} \N{snowman}".format(foo=1))
74 74 | 
75 75 | print(("foo %s " "bar %s") % (x, y))
76 76 | 

UP031_0.py:75:7: UP031 [*] Use format specifiers instead of percent format
   |
75 | print("%(foo)s \N{snowman}" % {"foo": 1})
76 | 
77 | print(("foo %s " "bar %s") % (x, y))
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
78 | 
79 | # Single-value expressions
   |
   = help: Replace with format specifiers

ℹ Suggested fix
72 72 | 
73 73 | print("%(foo)s \N{snowman}" % {"foo": 1})
74 74 | 
75    |-print(("foo %s " "bar %s") % (x, y))
   75 |+print(("foo {} " "bar {}").format(x, y))
76 76 | 
77 77 | # Single-value expressions
78 78 | print('Hello %s' % "World")

UP031_0.py:78:7: UP031 [*] Use format specifiers instead of percent format
   |
78 | # Single-value expressions
79 | print('Hello %s' % "World")
   |       ^^^^^^^^^^^^^^^^^^^^ UP031
80 | print('Hello %s' % f"World")
81 | print('Hello %s (%s)' % bar)
   |
   = help: Replace with format specifiers

ℹ Suggested fix
75 75 | print(("foo %s " "bar %s") % (x, y))
76 76 | 
77 77 | # Single-value expressions
78    |-print('Hello %s' % "World")
   78 |+print('Hello {}'.format("World"))
79 79 | print('Hello %s' % f"World")
80 80 | print('Hello %s (%s)' % bar)
81 81 | print('Hello %s (%s)' % bar.baz)

UP031_0.py:79:7: UP031 [*] Use format specifiers instead of percent format
   |
79 | # Single-value expressions
80 | print('Hello %s' % "World")
81 | print('Hello %s' % f"World")
   |       ^^^^^^^^^^^^^^^^^^^^^ UP031
82 | print('Hello %s (%s)' % bar)
83 | print('Hello %s (%s)' % bar.baz)
   |
   = help: Replace with format specifiers

ℹ Suggested fix
76 76 | 
77 77 | # Single-value expressions
78 78 | print('Hello %s' % "World")
79    |-print('Hello %s' % f"World")
   79 |+print('Hello {}'.format(f"World"))
80 80 | print('Hello %s (%s)' % bar)
81 81 | print('Hello %s (%s)' % bar.baz)
82 82 | print('Hello %s (%s)' % bar['bop'])

UP031_0.py:80:7: UP031 [*] Use format specifiers instead of percent format
   |
80 | print('Hello %s' % "World")
81 | print('Hello %s' % f"World")
82 | print('Hello %s (%s)' % bar)
   |       ^^^^^^^^^^^^^^^^^^^^^ UP031
83 | print('Hello %s (%s)' % bar.baz)
84 | print('Hello %s (%s)' % bar['bop'])
   |
   = help: Replace with format specifiers

ℹ Suggested fix
77 77 | # Single-value expressions
78 78 | print('Hello %s' % "World")
79 79 | print('Hello %s' % f"World")
80    |-print('Hello %s (%s)' % bar)
   80 |+print('Hello {} ({})'.format(*bar))
81 81 | print('Hello %s (%s)' % bar.baz)
82 82 | print('Hello %s (%s)' % bar['bop'])
83 83 | print('Hello %(arg)s' % bar)

UP031_0.py:81:7: UP031 [*] Use format specifiers instead of percent format
   |
81 | print('Hello %s' % f"World")
82 | print('Hello %s (%s)' % bar)
83 | print('Hello %s (%s)' % bar.baz)
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
84 | print('Hello %s (%s)' % bar['bop'])
85 | print('Hello %(arg)s' % bar)
   |
   = help: Replace with format specifiers

ℹ Suggested fix
78 78 | print('Hello %s' % "World")
79 79 | print('Hello %s' % f"World")
80 80 | print('Hello %s (%s)' % bar)
81    |-print('Hello %s (%s)' % bar.baz)
   81 |+print('Hello {} ({})'.format(*bar.baz))
82 82 | print('Hello %s (%s)' % bar['bop'])
83 83 | print('Hello %(arg)s' % bar)
84 84 | print('Hello %(arg)s' % bar.baz)

UP031_0.py:82:7: UP031 [*] Use format specifiers instead of percent format
   |
82 | print('Hello %s (%s)' % bar)
83 | print('Hello %s (%s)' % bar.baz)
84 | print('Hello %s (%s)' % bar['bop'])
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
85 | print('Hello %(arg)s' % bar)
86 | print('Hello %(arg)s' % bar.baz)
   |
   = help: Replace with format specifiers

ℹ Suggested fix
79 79 | print('Hello %s' % f"World")
80 80 | print('Hello %s (%s)' % bar)
81 81 | print('Hello %s (%s)' % bar.baz)
82    |-print('Hello %s (%s)' % bar['bop'])
   82 |+print('Hello {} ({})'.format(*bar['bop']))
83 83 | print('Hello %(arg)s' % bar)
84 84 | print('Hello %(arg)s' % bar.baz)
85 85 | print('Hello %(arg)s' % bar['bop'])

UP031_0.py:83:7: UP031 [*] Use format specifiers instead of percent format
   |
83 | print('Hello %s (%s)' % bar.baz)
84 | print('Hello %s (%s)' % bar['bop'])
85 | print('Hello %(arg)s' % bar)
   |       ^^^^^^^^^^^^^^^^^^^^^ UP031
86 | print('Hello %(arg)s' % bar.baz)
87 | print('Hello %(arg)s' % bar['bop'])
   |
   = help: Replace with format specifiers

ℹ Suggested fix
80 80 | print('Hello %s (%s)' % bar)
81 81 | print('Hello %s (%s)' % bar.baz)
82 82 | print('Hello %s (%s)' % bar['bop'])
83    |-print('Hello %(arg)s' % bar)
   83 |+print('Hello {arg}'.format(**bar))
84 84 | print('Hello %(arg)s' % bar.baz)
85 85 | print('Hello %(arg)s' % bar['bop'])
86 86 | 

UP031_0.py:84:7: UP031 [*] Use format specifiers instead of percent format
   |
84 | print('Hello %s (%s)' % bar['bop'])
85 | print('Hello %(arg)s' % bar)
86 | print('Hello %(arg)s' % bar.baz)
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
87 | print('Hello %(arg)s' % bar['bop'])
   |
   = help: Replace with format specifiers

ℹ Suggested fix
81 81 | print('Hello %s (%s)' % bar.baz)
82 82 | print('Hello %s (%s)' % bar['bop'])
83 83 | print('Hello %(arg)s' % bar)
84    |-print('Hello %(arg)s' % bar.baz)
   84 |+print('Hello {arg}'.format(**bar.baz))
85 85 | print('Hello %(arg)s' % bar['bop'])
86 86 | 
87 87 | # Hanging modulos

UP031_0.py:85:7: UP031 [*] Use format specifiers instead of percent format
   |
85 | print('Hello %(arg)s' % bar)
86 | print('Hello %(arg)s' % bar.baz)
87 | print('Hello %(arg)s' % bar['bop'])
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP031
88 | 
89 | # Hanging modulos
   |
   = help: Replace with format specifiers

ℹ Suggested fix
82 82 | print('Hello %s (%s)' % bar['bop'])
83 83 | print('Hello %(arg)s' % bar)
84 84 | print('Hello %(arg)s' % bar.baz)
85    |-print('Hello %(arg)s' % bar['bop'])
   85 |+print('Hello {arg}'.format(**bar['bop']))
86 86 | 
87 87 | # Hanging modulos
88 88 | (

UP031_0.py:88:1: UP031 [*] Use format specifiers instead of percent format
   |
88 |   # Hanging modulos
89 | / (
90 | |     "foo %s "
91 | |     "bar %s"
92 | | ) % (x, y)
   | |__________^ UP031
93 |   
94 |   (
   |
   = help: Replace with format specifiers

ℹ Suggested fix
86 86 | 
87 87 | # Hanging modulos
88 88 | (
89    |-    "foo %s "
90    |-    "bar %s"
91    |-) % (x, y)
   89 |+    "foo {} "
   90 |+    "bar {}"
   91 |+).format(x, y)
92 92 | 
93 93 | (
94 94 |     "foo %(foo)s "

UP031_0.py:93:1: UP031 [*] Use format specifiers instead of percent format
    |
 93 |   ) % (x, y)
 94 |   
 95 | / (
 96 | |     "foo %(foo)s "
 97 | |     "bar %(bar)s"
 98 | | ) % {"foo": x, "bar": y}
    | |________________________^ UP031
 99 |   
100 |   (
    |
    = help: Replace with format specifiers

ℹ Suggested fix
91 91 | ) % (x, y)
92 92 | 
93 93 | (
94    |-    "foo %(foo)s "
95    |-    "bar %(bar)s"
96    |-) % {"foo": x, "bar": y}
   94 |+    "foo {foo} "
   95 |+    "bar {bar}"
   96 |+).format(foo=x, bar=y)
97 97 | 
98 98 | (
99 99 |     """foo %s"""

UP031_0.py:99:5: UP031 [*] Use format specifiers instead of percent format
    |
 99 |   (
100 |       """foo %s"""
    |  _____^
101 | |     % (x,)
    | |__________^ UP031
102 |   )
    |
    = help: Replace with format specifiers

ℹ Suggested fix
96  96  | ) % {"foo": x, "bar": y}
97  97  | 
98  98  | (
99      |-    """foo %s"""
100     |-    % (x,)
    99  |+    """foo {}""".format(x)
101 100 | )
102 101 | 
103 102 | (

UP031_0.py:104:5: UP031 [*] Use format specifiers instead of percent format
    |
104 |   (
105 |       """
    |  _____^
106 | |     foo %s
107 | |     """
108 | |     % (x,)
    | |__________^ UP031
109 |   )
    |
    = help: Replace with format specifiers

ℹ Suggested fix
102 102 | 
103 103 | (
104 104 |     """
105     |-    foo %s
106     |-    """
107     |-    % (x,)
    105 |+    foo {}
    106 |+    """.format(x)
108 107 | )


