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
Overloaded functions should not have docstrings as the docstrings should be in the implemented function.
Maybe I missed something, but is there a way to ignore all @overload decorated functions?
This file should not raise any errors
"""File docstring."""
from typing import overload
@overload
def hello(a: str) -> str: ...
@overload
def hello(a: int) -> int: ...
def hello(a: str | int) -> str | int:
"""Return a.
Parameters
----------
a : int or str
Parameter a.
Returns
-------
int or str
Returns a.
"""
return a
numpydoc lint file.py --ignore ES01 SA01 EX01 GL01 does raise this
+-----------------------------------+----------------+---------+--------------------------------------+
| file | item | check | description |
+===================================+================+=========+======================================+
| .\src\test_numpydoc\__init__.py:6 | __init__.hello | GL08 | The object does not have a docstring |
+-----------------------------------+----------------+---------+--------------------------------------+
| .\src\test_numpydoc\__init__.py:9 | __init__.hello | GL08 | The object does not have a docstring |
+-----------------------------------+----------------+---------+--------------------------------------+
The text was updated successfully, but these errors were encountered:
FelipeCybis
changed the title
FR: ignore @overload decorated objects
Feature Request: ignore @overload decorated objects
May 22, 2024
Overloaded functions should not have docstrings as the docstrings should be in the implemented function.
Maybe I missed something, but is there a way to ignore all
@overload
decorated functions?This file should not raise any errors
numpydoc lint file.py --ignore ES01 SA01 EX01 GL01
does raise thisThe text was updated successfully, but these errors were encountered: