Closed tmke8 closed 1 year ago
Hi, I could not reproduce this issue. Could you double check your code snippet, and can you provide the configs that you used?
Thanks!
Oh, sorry about that! I didn't check that my minimal reproduction still had the error... rookie mistake.
It seems there need to be type annotations for this to happen:
from typing import Any
def f(*args: Any, **kwargs: Any) -> None:
"""My function.
:param \\*args: Positional args.
:param \\**kwargs: Keyword args.
"""
Save this as args_kwargs.py
and run
pydoclint --style=sphinx --arg-type-hints-in-docstring=False --check-return-types=False --check-yield-types=False args_kwargs.py
gives
Loading config from user-specified .toml file: pyproject.toml
File "pyproject.toml" does not exist; nothing to load.
Skipping files that match this pattern: \.git|\.tox
args_kwargs.py
args_kwargs.py
4: DOC103: Function `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: [**kwargs: Any, *args: Any]. Arguments in the docstring but not in the function signature: [\**kwargs: , \*args: ].
Thanks for updating the example! I was able to reproduce it, and I made a code change to fix this bug.
Thank you so much! You made a great tool!
Given this
sphinx throws a warning:
and this also seems to mess with the formatting a bit.
But when it's escaped with a backslash, it's fine:
However, pydoclint then complains:
So, it seems the backslash confuses pydoclint.