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

ℹ Safe 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
  |
7 | if foo:
8 |     """foo"""
9 |     pass
  |     ^^^^ PIE790
  |
  = help: Remove unnecessary `pass`

ℹ Safe 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
   |
12 | def multi_statement() -> None:
13 |     """This is a function."""
14 |     pass; print("hello")
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
19 | else:
20 |     """bar"""
21 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
26 | else:
27 |     """bar"""
28 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
33 | else:
34 |     """bar"""
35 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
40 | else:
41 |     """bar"""
42 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
48 |     """
49 | 
50 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
56 |     """
57 | 
58 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
63 |     buzz
64 |     """
65 |     pass
   |     ^^^^ PIE790
66 | except ValueError:
67 |     pass
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
72 | except ValueError:
73 |     """bar"""
74 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
77 | for _ in range(10):
78 |     """buzz"""
79 |     pass
   |     ^^^^ PIE790
80 | 
81 | async for _ in range(10):
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
81 | async for _ in range(10):
82 |     """buzz"""
83 |     pass
   |     ^^^^ PIE790
84 | 
85 | while cond:
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
85 | while cond:
86 |     """buzz"""
87 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
90 | with bar:
91 |     """buzz"""
92 |     pass
   |     ^^^^ PIE790
93 | 
94 | async with bar:
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
   |
94 | async with bar:
95 |     """buzz"""
96 |     pass
   |     ^^^^ PIE790
   |
   = help: Remove unnecessary `pass`

ℹ Safe 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
    |
 99 | def foo() -> None:
100 |     """buzz"""
101 |     pass  # bar
    |     ^^^^ PIE790
    |
    = help: Remove unnecessary `pass`

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

PIE790.py:130:5: PIE790 [*] Unnecessary `pass` statement
    |
128 | def foo():
129 |     print("foo")
130 |     pass
    |     ^^^^ PIE790
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
127 127 | 
128 128 | def foo():
129 129 |     print("foo")
130     |-    pass
131 130 | 
132 131 | 
133 132 | def foo():

PIE790.py:136:5: PIE790 [*] Unnecessary `pass` statement
    |
134 |     """A docstring."""
135 |     print("foo")
136 |     pass
    |     ^^^^ PIE790
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
133 133 | def foo():
134 134 |     """A docstring."""
135 135 |     print("foo")
136     |-    pass
137 136 | 
138 137 | 
139 138 | for i in range(10):

PIE790.py:140:5: PIE790 [*] Unnecessary `pass` statement
    |
139 | for i in range(10):
140 |     pass
    |     ^^^^ PIE790
141 |     pass
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
138 138 | 
139 139 | for i in range(10):
140 140 |     pass
141     |-    pass
142 141 | 
143 142 | for i in range(10):
144 143 |     pass

PIE790.py:141:5: PIE790 [*] Unnecessary `pass` statement
    |
139 | for i in range(10):
140 |     pass
141 |     pass
    |     ^^^^ PIE790
142 | 
143 | for i in range(10):
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
138 138 | 
139 139 | for i in range(10):
140 140 |     pass
141     |-    pass
142 141 | 
143 142 | for i in range(10):
144 143 |     pass

PIE790.py:144:5: PIE790 [*] Unnecessary `pass` statement
    |
143 | for i in range(10):
144 |     pass
    |     ^^^^ PIE790
145 | 
146 |     pass
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
141 141 |     pass
142 142 | 
143 143 | for i in range(10):
144     |-    pass
145 144 | 
146 145 |     pass
147 146 | 

PIE790.py:146:5: PIE790 [*] Unnecessary `pass` statement
    |
144 |     pass
145 | 
146 |     pass
    |     ^^^^ PIE790
147 | 
148 | for i in range(10):
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
143 143 | for i in range(10):
144 144 |     pass
145 145 | 
146     |-    pass
147 146 | 
148 147 | for i in range(10):
149 148 |     pass  # comment

PIE790.py:149:5: PIE790 [*] Unnecessary `pass` statement
    |
148 | for i in range(10):
149 |     pass  # comment
    |     ^^^^ PIE790
150 |     pass
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
146 146 |     pass
147 147 | 
148 148 | for i in range(10):
149     |-    pass  # comment
    149 |+    # comment
150 150 |     pass
151 151 | 
152 152 | 

PIE790.py:150:5: PIE790 [*] Unnecessary `pass` statement
    |
148 | for i in range(10):
149 |     pass  # comment
150 |     pass
    |     ^^^^ PIE790
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
147 147 | 
148 148 | for i in range(10):
149 149 |     pass  # comment
150     |-    pass
151 150 | 
152 151 | 
153 152 | def foo():

PIE790.py:155:5: PIE790 [*] Unnecessary `...` literal
    |
153 | def foo():
154 |     print("foo")
155 |     ...
    |     ^^^ PIE790
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
152 152 | 
153 153 | def foo():
154 154 |     print("foo")
155     |-    ...
156 155 | 
157 156 | 
158 157 | def foo():

PIE790.py:161:5: PIE790 [*] Unnecessary `...` literal
    |
159 |     """A docstring."""
160 |     print("foo")
161 |     ...
    |     ^^^ PIE790
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
158 158 | def foo():
159 159 |     """A docstring."""
160 160 |     print("foo")
161     |-    ...
162 161 | 
163 162 | 
164 163 | for i in range(10):

PIE790.py:165:5: PIE790 [*] Unnecessary `...` literal
    |
164 | for i in range(10):
165 |     ...
    |     ^^^ PIE790
166 |     ...
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
163 163 | 
164 164 | for i in range(10):
165 165 |     ...
166     |-    ...
167 166 | 
168 167 | for i in range(10):
169 168 |     ...

PIE790.py:166:5: PIE790 [*] Unnecessary `...` literal
    |
164 | for i in range(10):
165 |     ...
166 |     ...
    |     ^^^ PIE790
167 | 
168 | for i in range(10):
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
163 163 | 
164 164 | for i in range(10):
165 165 |     ...
166     |-    ...
167 166 | 
168 167 | for i in range(10):
169 168 |     ...

PIE790.py:169:5: PIE790 [*] Unnecessary `...` literal
    |
168 | for i in range(10):
169 |     ...
    |     ^^^ PIE790
170 | 
171 |     ...
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
166 166 |     ...
167 167 | 
168 168 | for i in range(10):
169     |-    ...
170 169 | 
171 170 |     ...
172 171 | 

PIE790.py:171:5: PIE790 [*] Unnecessary `...` literal
    |
169 |     ...
170 | 
171 |     ...
    |     ^^^ PIE790
172 | 
173 | for i in range(10):
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
168 168 | for i in range(10):
169 169 |     ...
170 170 | 
171     |-    ...
172 171 | 
173 172 | for i in range(10):
174 173 |     ...  # comment

PIE790.py:174:5: PIE790 [*] Unnecessary `...` literal
    |
173 | for i in range(10):
174 |     ...  # comment
    |     ^^^ PIE790
175 |     ...
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
171 171 |     ...
172 172 | 
173 173 | for i in range(10):
174     |-    ...  # comment
    174 |+    # comment
175 175 |     ...
176 176 | 
177 177 | for i in range(10):

PIE790.py:175:5: PIE790 [*] Unnecessary `...` literal
    |
173 | for i in range(10):
174 |     ...  # comment
175 |     ...
    |     ^^^ PIE790
176 | 
177 | for i in range(10):
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
172 172 | 
173 173 | for i in range(10):
174 174 |     ...  # comment
175     |-    ...
176 175 | 
177 176 | for i in range(10):
178 177 |     ...

PIE790.py:178:5: PIE790 [*] Unnecessary `...` literal
    |
177 | for i in range(10):
178 |     ...
    |     ^^^ PIE790
179 |     pass
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
175 175 |     ...
176 176 | 
177 177 | for i in range(10):
178     |-    ...
179 178 |     pass
180 179 | 
181 180 | from typing import Protocol

PIE790.py:179:5: PIE790 [*] Unnecessary `pass` statement
    |
177 | for i in range(10):
178 |     ...
179 |     pass
    |     ^^^^ PIE790
180 | 
181 | from typing import Protocol
    |
    = help: Remove unnecessary `pass`

ℹ Safe fix
176 176 | 
177 177 | for i in range(10):
178 178 |     ...
179     |-    pass
180 179 | 
181 180 | from typing import Protocol
182 181 | 

PIE790.py:209:9: PIE790 [*] Unnecessary `...` literal
    |
207 |     def stub(self) -> str:
208 |         """Docstring"""
209 |         ...
    |         ^^^ PIE790
    |
    = help: Remove unnecessary `...`

ℹ Safe fix
206 206 | 
207 207 |     def stub(self) -> str:
208 208 |         """Docstring"""
209     |-        ...
210 209 | 
211 210 | 
212 211 | class Repro(Protocol[int]):


