Open xome4ok opened 3 years ago
Another example:
def validate(exception=MatrixError):
"""
Validate something.
Arguments:
exception: The exception type.
Raises:
MatrixError: When the validation failed.
"""
...
raise exception(message)
Missing exception(s) in Raises section: -r exception
This code might not be considered best-practice of course, but in some cases it's unavoidable :sweat_smile:
If a result of a function, that returns exception is raised, darglint treats this function itself as an exception.
Consider the following example:
When I run darglint, I expect it to run without issues, but it insists that
some_function
raises not anExcpetion
instance, butraise_an_error
.Reproduced on Python 3.9.2