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
19 changed files with 452 additions and 925 deletions

View file

@ -1,6 +1,5 @@
"""
cd to the `examples/snippets` directory and run:
uv run completion-client
"""cd to the `examples/snippets` directory and run:
uv run completion-client
"""
import asyncio

View file

@ -1,6 +1,5 @@
"""
cd to the `examples/snippets` directory and run:
uv run display-utilities-client
"""cd to the `examples/snippets` directory and run:
uv run display-utilities-client
"""
import asyncio

View file

@ -1,5 +1,4 @@
"""
Before running, specify running MCP RS server URL.
"""Before running, specify running MCP RS server URL.
To spin up RS server locally, see
examples/servers/simple-auth/README.md

View file

@ -1,6 +1,4 @@
"""
Example of consuming paginated MCP endpoints from a client.
"""
"""Example of consuming paginated MCP endpoints from a client."""
import asyncio

View file

@ -1,6 +1,5 @@
"""
cd to the `examples/snippets/clients` directory and run:
uv run client
"""cd to the `examples/snippets/clients` directory and run:
uv run client
"""
import asyncio

View file

@ -1,6 +1,5 @@
"""
Run from the repository root:
uv run examples/snippets/clients/streamable_basic.py
"""Run from the repository root:
uv run examples/snippets/clients/streamable_basic.py
"""
import asyncio

View file

@ -1,5 +1,4 @@
"""
FastMCP quickstart example.
"""FastMCP quickstart example.
Run from the repository root:
uv run examples/snippets/servers/fastmcp_quickstart.py

View file

@ -1,5 +1,4 @@
"""
Run from the repository root:
"""Run from the repository root:
uv run examples/snippets/servers/lowlevel/basic.py
"""

View file

@ -1,6 +1,5 @@
"""
Run from the repository root:
uv run examples/snippets/servers/lowlevel/direct_call_tool_result.py
"""Run from the repository root:
uv run examples/snippets/servers/lowlevel/direct_call_tool_result.py
"""
import asyncio

View file

@ -1,6 +1,5 @@
"""
Run from the repository root:
uv run examples/snippets/servers/lowlevel/lifespan.py
"""Run from the repository root:
uv run examples/snippets/servers/lowlevel/lifespan.py
"""
from collections.abc import AsyncIterator

View file

@ -1,6 +1,5 @@
"""
Run from the repository root:
uv run examples/snippets/servers/lowlevel/structured_output.py
"""Run from the repository root:
uv run examples/snippets/servers/lowlevel/structured_output.py
"""
import asyncio

View file

@ -1,6 +1,5 @@
"""
Run from the repository root:
uv run examples/snippets/servers/oauth_server.py
"""Run from the repository root:
uv run examples/snippets/servers/oauth_server.py
"""
from pydantic import AnyHttpUrl

View file

@ -1,6 +1,4 @@
"""
Example of implementing pagination with MCP server decorators.
"""
"""Example of implementing pagination with MCP server decorators."""
import mcp.types as types
from mcp.server.lowlevel import Server

View file

@ -1,6 +1,5 @@
"""
Run from the repository root:
uv run examples/snippets/servers/streamable_config.py
"""Run from the repository root:
uv run examples/snippets/servers/streamable_config.py
"""
from mcp.server.fastmcp import FastMCP

View file

@ -1,5 +1,4 @@
"""
Basic example showing how to mount StreamableHTTP server in Starlette.
"""Basic example showing how to mount StreamableHTTP server in Starlette.
Run from the repository root:
uvicorn examples.snippets.servers.streamable_http_basic_mounting:app --reload

View file

@ -1,5 +1,4 @@
"""
Example showing how to mount StreamableHTTP server using Host-based routing.
"""Example showing how to mount StreamableHTTP server using Host-based routing.
Run from the repository root:
uvicorn examples.snippets.servers.streamable_http_host_mounting:app --reload

View file

@ -1,5 +1,4 @@
"""
Example showing how to mount multiple StreamableHTTP servers with path configuration.
"""Example showing how to mount multiple StreamableHTTP servers with path configuration.
Run from the repository root:
uvicorn examples.snippets.servers.streamable_http_multiple_servers:app --reload

View file

@ -1,5 +1,4 @@
"""
Example showing path configuration when mounting FastMCP.
"""Example showing path configuration when mounting FastMCP.
Run from the repository root:
uvicorn examples.snippets.servers.streamable_http_path_config:app --reload

View file

@ -1,6 +1,5 @@
"""
Run from the repository root:
uvicorn examples.snippets.servers.streamable_starlette_mount:app --reload
"""Run from the repository root:
uvicorn examples.snippets.servers.streamable_starlette_mount:app --reload
"""
import contextlib