Skip to content

Commit b363959

Browse files
committed
Ignore false positives for pydoclint check DOC503
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 0363d74 commit b363959

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/frequenz/core/asyncio/_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ def cancel(self, msg: str | None = None) -> None:
327327
self._main_task.cancel(msg)
328328
self._task_group.cancel(msg)
329329

330+
# We need to use noqa here because pydoclint can't figure out that rest is actually
331+
# an instance of BaseExceptionGroup.
330332
@override
331-
async def stop(self, msg: str | None = None) -> None:
333+
async def stop(self, msg: str | None = None) -> None: # noqa: DOC503
332334
"""Stop this service.
333335
334336
This method cancels all running tasks spawned by this service and waits for them

src/frequenz/core/asyncio/_task_group.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ def cancel(self, msg: str | None = None) -> None:
227227
for task in self._running:
228228
task.cancel(msg)
229229

230-
async def stop(self, msg: str | None = None) -> None:
230+
# We need to use noqa here because pydoclint can't figure out that rest is actually
231+
# an instance of BaseExceptionGroup.
232+
async def stop(self, msg: str | None = None) -> None: # noqa: DOC503
231233
"""Stop this task group.
232234
233235
This method cancels all running tasks spawned by this group and waits for them

src/frequenz/core/typing.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ def decorator(inner_cls: TypeT) -> TypeT:
137137
class _NoInitConstructibleMeta(type):
138138
"""A metaclass that disables the __init__ constructor."""
139139

140-
def __new__(
140+
# We need to use noqa here because pydoclint can't figure out that
141+
# _get_no_init_constructible_error() returns a TypeError.
142+
def __new__( # noqa: DOC503
141143
mcs,
142144
name: str,
143145
bases: tuple[type, ...],
@@ -173,7 +175,9 @@ def __init__(
173175
super().__init__(name, bases, namespace)
174176
cls._no_init_constructible_error = kwargs.get("no_init_constructible_error")
175177

176-
def __call__(cls, *args: Any, **kwargs: Any) -> NoReturn:
178+
# We need to use noqa here because pydoclint can't figure out that
179+
# _get_no_init_constructible_error() returns a TypeError.
180+
def __call__(cls, *args: Any, **kwargs: Any) -> NoReturn: # noqa: DOC503
177181
"""Raise an error when the __init__ constructor is called.
178182
179183
Args:

0 commit comments

Comments
 (0)