python.lang.best-practice.pass-body.pass-body-range

Author
6,393
Download Count*
License
pass
is the body of for $X in $Y. Consider removing this or raise NotImplementedError() if this is a TODO
Run Locally
Run in CI
Defintion
rules:
- id: pass-body-range
pattern: |
for $X in $Y:
pass
message: "`pass` is the body of for $X in $Y. Consider removing this or raise
NotImplementedError() if this is a TODO"
languages:
- python
severity: WARNING
metadata:
category: best-practice
technology:
- python
license: Commons Clause License Condition v1.0[LGPL-2.1-only]
Examples
pass-body.py
# ruleid:pass-body-range
for i in range(100):
pass
# ruleid:pass-body-fn
def foo():
pass
def __init__(self):
# ok:pass-body-fn
pass
def __init__(self, other):
# ok:pass-body-fn
pass
class foo:
def somemethod():
# ok:pass-body-fn
pass
class foobar:
def someothermethod():
# ruleid:pass-body-range
for i in range(100):
pass
Short Link: https://sg.run/rdJR