jdkandersson / flake8-docstrings-complete

Apache License 2.0
12 stars 2 forks source link

shouldn't raise DCO050 if all exceptions are caught #30

Open Xoriun opened 2 weeks ago

Xoriun commented 2 weeks ago

I have a method that can raise some exceptions but all of those manually raise exception are caught with except clauses. Imo, in this case it would be unnecessary to have the Raises: block in the docstring of the method.

MWE:

def test():
    """docstring."""
    try:
        raise RuntimeError('test')
    except RuntimeError:
        print('caught')

This raises an DCO050 in the docstring line although this RuntimeError will never be propagated to outside the method.