Open gschwaer opened 2 years ago
This extends to any raise
that is not purely instantiating a class (or probably calling a function in general). For example:
def test(self):
"""[summary]
Raises:
ValueError: [description]
"""
try:
print("")
except ValueError as e:
# Do something with e
raise e
Will also produce a bogus:
test.py:traceback_test:42: DAR401: -r e
test.py:traceback_test:46: DAR402: +r ValueError
BTW, this can be workaround by using a noqa
:
def test(self):
"""[summary]
Raises:
ValueError: [description]
# noqa: DAR401 e
"""
try:
print("")
except ValueError as e:
# Do something with e
raise e
Or with_traceback
instead of e
in the original example.
The following code generates two darglint errors:
Observed Behavior
It seems darglint does not know of the
with_traceback()
function.Expected Behavior
In this case no error at all.
with_traceback
should be interpreted as if it wasn't there because it returns the same exception object.