chore: add D212 lint rule to enforce Google-style docstrings (#1892)

This commit is contained in:
Felix Weinberger 2026-01-16 16:10:52 +00:00 • committed by GitHub
commit d41d0c0128
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,4 @@
"""
TaskSupport - Configuration for experimental task support.
"""TaskSupport - Configuration for experimental task support.
This module provides the TaskSupport class which encapsulates all the
infrastructure needed for task-augmented requests: store, queue, and handler.
@ -21,8 +20,7 @@ from mcp.shared.experimental.tasks.store import TaskStore
@dataclass
class TaskSupport:
"""
Configuration for experimental task support.
"""Configuration for experimental task support.
Encapsulates the task store, message queue, result handler, and task group
for spawning background work.
@ -65,8 +63,7 @@ class TaskSupport:
@asynccontextmanager
async def run(self) -> AsyncIterator[None]:
"""
Run the task support lifecycle.
"""Run the task support lifecycle.
This creates a task group for spawning background task work.
Called automatically by Server.run().
@ -84,8 +81,7 @@ class TaskSupport:
self._task_group = None
def configure_session(self, session: ServerSession) -> None:
"""
Configure a session for task support.
"""Configure a session for task support.
This registers the result handler as a response router so that
responses to queued requests (elicitation, sampling) are routed
@ -100,8 +96,7 @@ class TaskSupport:
@classmethod
def in_memory(cls) -> "TaskSupport":
"""
Create in-memory task support.
"""Create in-memory task support.
Suitable for development, testing, and single-process servers.
For distributed systems, provide custom store and queue implementations.