Derived from the flake8-pie linter.
Fix is always available.
What it does#
Checks for unnecessary
pass statements in functions, classes, and other
In preview, this rule also checks for unnecessary ellipsis (
Why is this bad?#
In Python, the
pass statement and ellipsis (
...) literal serve as
placeholders, allowing for syntactically correct empty code blocks. The
primary purpose of these nodes is to avoid syntax errors in situations
where a statement or expression is syntactically required, but no code
needs to be executed.
pass or ellipsis is present in a code block that includes at least
one other statement (even, e.g., a docstring), it is unnecessary and should