-
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
Arguments wrongly listed as missing based on type #85
Comments
Hi @ezwelty , this is because there needs to be Please check out the note in this error message:
|
@jsh9 Did you maybe misread my issue? The """Module docstring."""
def f(x: int, y: int, z: int) -> None:
"""
Run f().
Parameters
----------
x
x
y
y
z
z
"""
pass |
Thanks for the clarification! I made a code change and now your test case should produce the following error message: Lines 1090 to 1097 in bef414f
Note that the error message shows |
The code change is published as v0.3.4 to PyPI. |
Version includes fix of a bug making it difficult to interpret errors reported when docstring arguments did not match function signature. See jsh9/pydoclint#85.
I believe I've stumbled into a bug, or at least a usability issue.
Say we have the following
test.py
:Running
pydoclint
with--arg-type-hints-in-docstring False
results in the following:f
: Docstring contains fewer arguments than in function signature.f
: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [x: int, y: int, z: int]. Arguments in the docstring but not in the function signature: [y: , z: ].It seems that the latter part should just be Arguments in the function signature but not in the docstring: [x: int].
Adding
x
to the docstring removes all errors. Likewise, adding--arg-type-hints-in-signature False
and removing the type annotations results in the expected error Arguments in the function signature but not in the docstring: [x: ].The text was updated successfully, but these errors were encountered: