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
When using decorators, the numpydoc ignore inline comment does not seem to be recognized by either numpydoc --validate or the validation during Sphinx build. Here's a reprex, stored as test.py:
importfunctoolsdeftest_decorator(func):
@functools.wraps(func)defwrapper(*args, **kwargs):
returnfunc(*args, **kwargs)
returnwrapper@test_decoratordeftest_function(): # numpydoc ignore=PR02"""Test. Parameters ---------- x : int Test. """print("test")
Using python -m numpydoc --validate test.test_function raises the warning test.test_function:PR02:Unknown parameters {'x'} when the decorator is used, but doesn't when the decorator is removed. Same thing when using validation during a Sphinx build. Interestingly, validation using python -m numpydoc.hooks.validate_docstrings test.py does not raise the PR02 warning, even when using the decorator.
The text was updated successfully, but these errors were encountered:
#500 will allow the validator to handle properties (@property and @cached_property). Note however that custom decorators that don't make use of @functools.wraps or return anything other than the function itself will not be handled by the validator.
When using decorators, the
numpydoc ignore
inline comment does not seem to be recognized by eithernumpydoc --validate
or the validation during Sphinx build. Here's a reprex, stored astest.py
:Using
python -m numpydoc --validate test.test_function
raises the warningtest.test_function:PR02:Unknown parameters {'x'}
when the decorator is used, but doesn't when the decorator is removed. Same thing when using validation during a Sphinx build. Interestingly, validation usingpython -m numpydoc.hooks.validate_docstrings test.py
does not raise the PR02 warning, even when using the decorator.The text was updated successfully, but these errors were encountered: