-
Notifications
You must be signed in to change notification settings - Fork 18
feature request: support for Other parameters
#222
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
Comments
Other linters such as |
Hi @mflova , Is "Other parameters" an official (or at least popular) way of writing docstrings? If so, is is only for the Google style? |
Not really. I found it in mkdocstrings and apparently, other tools such as Ruff ended up implementing this logic as well. However, I cannot trace its origin back. In official convention I did not find anything regarding this matter so I am not sure if its implementation makes sense |
If you have some time to implement this into the docstring parser (which pydoclint depends on), that would be a great help. And then I can modify pydoclint to incorporate this change. I didn't write the docstring parser myself (I forked it), but I think this is where you add a detector for the section "Other parameters": And "Other parameters" is actually recognized in the numpy style in the docstring parser here: https://github.com/jsh9/docstring_parser_fork/blob/e0afb74a5a4d15f5646355f6558f6518a9569247/docstring_parser/numpydoc.py#L316 I think you can follow the logic. |
Plugins like
mkdocstrings
allow to splitArgs
betweenArgs
andOther parameters
. See link below:(https://mkdocstrings.github.io/python/usage/configuration/docstrings/#show_docstring_other_parameters)
This is helpful when you want to generate documentation from docstrings while hiding some input arguments from the documentation generation. This situation happens quite often in inheritance-based patterns:
In this case, the only interface requirement from
Foo
is a function calledfunc
that admits only keyword arguments, but can be any. If we override the class and createSubFoo
, we can create our ownfunc
. In this example, I made it admitrandom_arg
. However, I am forced to write**kwargs
if I want to keep the interface where any kwargs can be sent to the function. In this case, forSubFoo
,kwargs
is not "technically" a useful parameter. Therefore, from the point of view of the user, I writekwargs
underOther parameters
and hide thsi section while generating the documentation of the function.I am aware that you can avoid the documentation of
*args
and**kwargs
. However, in my repository I have other functions whereargs
andkwargs
makes sense from the user point of view perspective:Solutions I considered about this problem:
Other parameters
as part ofArgs
Args:
, check them. If they are not present or inOther parameters
, ignore themThe text was updated successfully, but these errors were encountered: