You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In numpy style, when the underscoring count doesn't match the "Parameter", then pydoclint (version 0.3.8) reports error about arguments.
Example code:
def example(parameter: int) -> int:
"""This is a example function.
Parameters
------
parameter : int
This is a example parameter.
Returns
-------
int
This is a example return value.
"""
print(parameter)
return parameter
Errors reported:
1: DOC101: Function `example`: Docstring contains fewer arguments than in function signature.
1: DOC109: Function `example`: The option `--arg-type-hints-in-docstring` is `True` but there are no type hints in the docstring arg list
1: DOC103: Function `example`: 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: [parameter: int].
No errors are reported when the underscores are fixed to match the "Parameters" line.
The text was updated successfully, but these errors were encountered:
I can potentially make changes to the parser for it to be more "false tolerant", but there's a limit of how far this "tolerating" can go, because there can be infinitely many ways that a docstring can be incorrectly written.
So I feel that an easier "catch-all" way would be to update the error message or documentation to say "you are seeing this violation probably because your docstring isn't correctly formatted".
In fact, the message in DOC103 already kind of says that. I just need to refine it a bit.
In numpy style, when the underscoring count doesn't match the "Parameter", then pydoclint (version 0.3.8) reports error about arguments.
Example code:
Errors reported:
No errors are reported when the underscores are fixed to match the "Parameters" line.
The text was updated successfully, but these errors were encountered: