---
source: crates/ruff/src/rules/flake8_pie/mod.rs
---
PIE790.py:4:5: PIE790 [*] Unnecessary `pass` statement
  |
4 |     """buzz"""
5 | 
6 |     pass
  |     ^^^^ PIE790
  |
  = help: Remove unnecessary `pass`

ℹ Suggested fix
1 1 | class Foo:
2 2 |     """buzz"""
3 3 | 
4   |-    pass
5 4 | 
6 5 | 
7 6 | if foo:

PIE790.py:9:5: PIE790 [*] Unnecessary `pass` statement
   |
 9 | if foo:
10 |     """foo"""
11 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
6  6  | 
7  7  | if foo:
8  8  |     """foo"""
9     |-    pass
10 9  | 
11 10 | 
12 11 | def multi_statement() -> None:

PIE790.py:14:5: PIE790 [*] Unnecessary `pass` statement
   |
14 | def multi_statement() -> None:
15 |     """This is a function."""
16 |     pass; print("hello")
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
11 11 | 
12 12 | def multi_statement() -> None:
13 13 |     """This is a function."""
14    |-    pass; print("hello")
   14 |+    print("hello")
15 15 | 
16 16 | 
17 17 | if foo:

PIE790.py:21:5: PIE790 [*] Unnecessary `pass` statement
   |
21 | else:
22 |     """bar"""
23 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
18 18 |     pass
19 19 | else:
20 20 |     """bar"""
21    |-    pass
22 21 | 
23 22 | 
24 23 | while True:

PIE790.py:28:5: PIE790 [*] Unnecessary `pass` statement
   |
28 | else:
29 |     """bar"""
30 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
25 25 |     pass
26 26 | else:
27 27 |     """bar"""
28    |-    pass
29 28 | 
30 29 | 
31 30 | for _ in range(10):

PIE790.py:35:5: PIE790 [*] Unnecessary `pass` statement
   |
35 | else:
36 |     """bar"""
37 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
32 32 |     pass
33 33 | else:
34 34 |     """bar"""
35    |-    pass
36 35 | 
37 36 | 
38 37 | async for _ in range(10):

PIE790.py:42:5: PIE790 [*] Unnecessary `pass` statement
   |
42 | else:
43 |     """bar"""
44 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
39 39 |     pass
40 40 | else:
41 41 |     """bar"""
42    |-    pass
43 42 | 
44 43 | 
45 44 | def foo() -> None:

PIE790.py:50:5: PIE790 [*] Unnecessary `pass` statement
   |
50 |     """
51 | 
52 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
47 47 |     buzz
48 48 |     """
49 49 | 
50    |-    pass
51 50 | 
52 51 | 
53 52 | async def foo():

PIE790.py:58:5: PIE790 [*] Unnecessary `pass` statement
   |
58 |     """
59 | 
60 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
55 55 |     buzz
56 56 |     """
57 57 | 
58    |-    pass
59 58 | 
60 59 | 
61 60 | try:

PIE790.py:65:5: PIE790 [*] Unnecessary `pass` statement
   |
65 |     buzz
66 |     """
67 |     pass
   |     ^^^^ PIE790
68 | except ValueError:
69 |     pass
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
62 62 |     """
63 63 |     buzz
64 64 |     """
65    |-    pass
66 65 | except ValueError:
67 66 |     pass
68 67 | 

PIE790.py:74:5: PIE790 [*] Unnecessary `pass` statement
   |
74 | except ValueError:
75 |     """bar"""
76 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
71 71 |     bar()
72 72 | except ValueError:
73 73 |     """bar"""
74    |-    pass
75 74 | 
76 75 | 
77 76 | for _ in range(10):

PIE790.py:79:5: PIE790 [*] Unnecessary `pass` statement
   |
79 | for _ in range(10):
80 |     """buzz"""
81 |     pass
   |     ^^^^ PIE790
82 | 
83 | async for _ in range(10):
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
76 76 | 
77 77 | for _ in range(10):
78 78 |     """buzz"""
79    |-    pass
80 79 | 
81 80 | async for _ in range(10):
82 81 |     """buzz"""

PIE790.py:83:5: PIE790 [*] Unnecessary `pass` statement
   |
83 | async for _ in range(10):
84 |     """buzz"""
85 |     pass
   |     ^^^^ PIE790
86 | 
87 | while cond:
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
80 80 | 
81 81 | async for _ in range(10):
82 82 |     """buzz"""
83    |-    pass
84 83 | 
85 84 | while cond:
86 85 |     """buzz"""

PIE790.py:87:5: PIE790 [*] Unnecessary `pass` statement
   |
87 | while cond:
88 |     """buzz"""
89 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
84 84 | 
85 85 | while cond:
86 86 |     """buzz"""
87    |-    pass
88 87 | 
89 88 | 
90 89 | with bar:

PIE790.py:92:5: PIE790 [*] Unnecessary `pass` statement
   |
92 | with bar:
93 |     """buzz"""
94 |     pass
   |     ^^^^ PIE790
95 | 
96 | async with bar:
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
89 89 | 
90 90 | with bar:
91 91 |     """buzz"""
92    |-    pass
93 92 | 
94 93 | async with bar:
95 94 |     """buzz"""

PIE790.py:96:5: PIE790 [*] Unnecessary `pass` statement
   |
96 | async with bar:
97 |     """buzz"""
98 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Suggested fix
93 93 | 
94 94 | async with bar:
95 95 |     """buzz"""
96    |-    pass
97 96 | 
98 97 | 
99 98 | def foo() -> None:

PIE790.py:101:5: PIE790 [*] Unnecessary `pass` statement
    |
101 | def foo() -> None:
102 |     """buzz"""
103 |     pass  # bar
    |     ^^^^ PIE790
    |
    = help: Remove unnecessary `pass`

ℹ Suggested fix
98  98  | 
99  99  | def foo() -> None:
100 100 |     """buzz"""
101     |-    pass  # bar
    101 |+    # bar
102 102 | 
103 103 | 
104 104 | class Foo:


