Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Xoriun opened this issue Sep 14, 2024 · 0 comments
Open

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

Xoriun opened this issue Sep 14, 2024 · 0 comments

Comments

@Xoriun
Copy link

Xoriun commented Sep 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant