-
Notifications
You must be signed in to change notification settings - Fork 15
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
False positive for return annotations using |
#66
Comments
Hi @haakonvt , thanks for reporting this issue! I did some research, and this is actually due to a bug in docstring_parser (the docstring parser that pydoclint uses to parse Google-style and Sphinx-style docstrings. When it sees this
it thinks the whole But it can process Let me post an issue over there. |
Oh, I see. Thanks for following up @jsh9 😄 |
The fix on the docstring_parser side is not that difficult, just tweaking a regex. However, there is not a lot of activities on that tool (its last release was almost a year ago, from September 2022). To deliver the fix to pydoclint users quickly, I forked it (https://github.com/jsh9/docstring_parser_fork), fixed it (jsh9/docstring_parser_fork#1), and published the fix to PyPI (https://pypi.org/project/docstring-parser-fork/). |
Published. Please try out version 0.1.9: https://github.com/jsh9/pydoclint/releases/tag/0.1.9 |
Swoosh, I love it! Thanks! |
I have a few files using the pipe operator instead of
typing.Union
, and I get what I think looks like a false positiveDOC203
.To reproduce:
When running the following file through
pydoclint
I get the following output:Do I have to use
-> Union[Foo, int]:
? Or what's wrong here 🤔The text was updated successfully, but these errors were encountered: