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
# buildifier: disable=function-docstring-args
def license(name, license_kinds = None, license_kind = None, copyright_notice = None, **kwargs):
"""Wrapper for license rule.
Args:
name: str target name.
license_kinds: list(label) list of license_kind targets.
license_kind: label a single license_kind. Only one of license_kind or license_kinds may
be specified
copyright_notice: str Copyright notice associated with this package.
"""
First of all, the parsing must be broken, because (without the disable line) I see the lint warning
Argument "**kwargs" is not documented.
https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#function-docstring-args
I added this to the docstring kwargs: additional args
And still get the above warning, plus
Argument "kwargs" is documented but doesn't exist in the function signature.
https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#function-docstring-args
This is a no win.
Suggested solution: Allow this in the docstring kwargs: [forwarded to <other rule name>]
The magical [fowarded to ...] would tell lint not to complain about it.
The could be used by Stardoc to pull up the definitions from the underlying rule, so we could document the wrapper appropriately.
The text was updated successfully, but these errors were encountered:
You should be able to document kwargs as **kwargs (with two asterisks), because just kwargs refers to a non-existing positional/keyword argument. In general, if the signature looks like
def f(foo, *bar, **baz):
you should define exactly the same literals in the documentation:
Args:
foo: ...
*bar: ...
**baz: ...
I don't see whether the magical [fowarded to ...] is useful, Buildifier doesn't analyze the documentation of each argument, it just makes sure it exists.
Consider this wrapper method:
First of all, the parsing must be broken, because (without the disable line) I see the lint warning
I added this to the docstring
kwargs: additional args
And still get the above warning, plus
This is a no win.
Suggested solution: Allow this in the docstring
kwargs: [forwarded to <other rule name>]
The magical [fowarded to ...] would tell lint not to complain about it.
The could be used by Stardoc to pull up the definitions from the underlying rule, so we could document the wrapper appropriately.
The text was updated successfully, but these errors were encountered: