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

Missed raises in match case blocks #63

Closed
jonyscathe opened this issue Aug 17, 2023 · 4 comments · Fixed by #64
Closed

Missed raises in match case blocks #63

jonyscathe opened this issue Aug 17, 2023 · 4 comments · Fixed by #64

Comments

@jonyscathe
Copy link

The following function has the error: Function test has a "Raises" section in the docstring, but there are not "raise" statements in the body Flake8(DOC502)

It doesn't matter if the ValueError is within the catchall case or one of the actual cases.

def test(number: int) -> bool:
    """
    Test function.

    :param number: A number
    :type number: int
    :raises ValueError: When number is not 1 or 2
    :return: True if number is 1, False if 2
    :rtype: bool
    """
    match number:
        case 1:
            return True
        case 2:
            return False
        case _:
            raise ValueError('Number is not 1 or 2.')
@jonyscathe
Copy link
Author

Oh, and relevant settings are:

skip-checking-short-docstrings = false
style = 'sphinx'

@jsh9
Copy link
Owner

jsh9 commented Aug 19, 2023

Hi @jonyscathe , thank you for raising this issue!

It is indeed a bug in the pydoclint code, and I have fixed it in #64.

@jsh9
Copy link
Owner

jsh9 commented Aug 19, 2023

This change is included in the new published version, 0.2.0.

@jonyscathe
Copy link
Author

Awesome.
Thanks so much for resolving things so quickly.

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

Successfully merging a pull request may close this issue.

2 participants