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

PIE790 [*] Unnecessary `pass` statement
 --> PIE790.py:9:5
  |
7 | if foo:
8 |     """foo"""
9 |     pass
  |     ^^^^
  |
help: Remove unnecessary `pass`
  |
8 |     """foo"""
  -     pass
9 |
  |

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

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:21:5
   |
19 | else:
20 |     """bar"""
21 |     pass
   |     ^^^^
   |
help: Remove unnecessary `pass`
   |
20 |     """bar"""
   -     pass
21 |
   |

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:28:5
   |
26 | else:
27 |     """bar"""
28 |     pass
   |     ^^^^
   |
help: Remove unnecessary `pass`
   |
27 |     """bar"""
   -     pass
28 |
   |

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:35:5
   |
33 | else:
34 |     """bar"""
35 |     pass
   |     ^^^^
   |
help: Remove unnecessary `pass`
   |
34 |     """bar"""
   -     pass
35 |
   |

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:42:5
   |
40 | else:
41 |     """bar"""
42 |     pass
   |     ^^^^
   |
help: Remove unnecessary `pass`
   |
41 |     """bar"""
   -     pass
42 |
   |

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:50:5
   |
48 |     """
49 |
50 |     pass
   |     ^^^^
   |
help: Remove unnecessary `pass`
   |
49 |
   -     pass
50 |
   |

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:58:5
   |
56 |     """
57 |
58 |     pass
   |     ^^^^
   |
help: Remove unnecessary `pass`
   |
57 |
   -     pass
58 |
   |

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:65:5
   |
63 |     buzz
64 |     """
65 |     pass
   |     ^^^^
66 | except ValueError:
67 |     pass
   |
help: Remove unnecessary `pass`
   |
64 |     """
   -     pass
65 | except ValueError:
   |

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:74:5
   |
72 | except ValueError:
73 |     """bar"""
74 |     pass
   |     ^^^^
   |
help: Remove unnecessary `pass`
   |
73 |     """bar"""
   -     pass
74 |
   |

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

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

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:87:5
   |
85 | while cond:
86 |     """buzz"""
87 |     pass
   |     ^^^^
   |
help: Remove unnecessary `pass`
   |
86 |     """buzz"""
   -     pass
87 |
   |

PIE790 [*] Unnecessary `pass` statement
  --> PIE790.py:92:5
   |
90 | with bar:
91 |     """buzz"""
92 |     pass
   |     ^^^^
93 |
94 | async with bar:
   |
help: Remove unnecessary `pass`
   |
91 |     """buzz"""
   -     pass
92 |
   |

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

PIE790 [*] Unnecessary `pass` statement
   --> PIE790.py:241:5
    |
239 | # https://github.com/astral-sh/ruff/issues/12616
240 | class PotentialDocstring1:
241 |     pass
    |     ^^^^
242 |     """
243 |     Lorem ipsum dolor sit amet.
    |
help: Remove unnecessary `pass`
    |
240 | class PotentialDocstring1:
    -     pass
241 |     """
    |
note: This is an unsafe fix and may change runtime behavior

PIE790 [*] Unnecessary `...` literal
   --> PIE790.py:248:5
    |
247 | class PotentialDocstring2:
248 |     ...
    |     ^^^
249 |     'Lorem ipsum dolor sit amet.'
    |
help: Remove unnecessary `...`
    |
247 | class PotentialDocstring2:
    -     ...
248 |     'Lorem ipsum dolor sit amet.'
    |
note: This is an unsafe fix and may change runtime behavior
