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

View file

@ -1,5 +1,4 @@
"""
FastMCP Complex inputs Example
"""FastMCP Complex inputs Example
Demonstrates validation via pydantic with complex models.
"""

View file

@ -1,5 +1,4 @@
"""
FastMCP Desktop Example
"""FastMCP Desktop Example
A simple example that exposes the desktop directory as a resource.
"""

View file

@ -1,6 +1,4 @@
"""
FastMCP Echo Server with direct CallToolResult return
"""
"""FastMCP Echo Server with direct CallToolResult return"""
from typing import Annotated

View file

@ -1,6 +1,4 @@
"""
FastMCP Echo Server
"""
"""FastMCP Echo Server"""
from mcp.server.fastmcp import FastMCP

View file

@ -1,5 +1,4 @@
"""
FastMCP Icons Demo Server
"""FastMCP Icons Demo Server
Demonstrates using icons with tools, resources, prompts, and implementation.
"""

View file

@ -1,6 +1,4 @@
"""
FastMCP Echo Server that sends log messages and progress updates to the client
"""
"""FastMCP Echo Server that sends log messages and progress updates to the client"""
import asyncio

View file

@ -4,8 +4,7 @@
# uv pip install 'pydantic-ai-slim[openai]' asyncpg numpy pgvector
"""
Recursive memory system inspired by the human brain's clustering of memories.
"""Recursive memory system inspired by the human brain's clustering of memories.
Uses OpenAI's 'text-embedding-3-small' model and pgvector for efficient
similarity search.
"""

View file

@ -1,6 +1,4 @@
"""
FastMCP Example showing parameter descriptions
"""
"""FastMCP Example showing parameter descriptions"""
from pydantic import Field

View file

@ -1,5 +1,4 @@
"""
FastMCP Screenshot Example
"""FastMCP Screenshot Example
Give Claude a tool to capture and view screenshots.
"""
@ -15,8 +14,7 @@ mcp = FastMCP("Screenshot Demo")
@mcp.tool()
def take_screenshot() -> Image:
"""
Take a screenshot of the user's screen and return it as an image. Use
"""Take a screenshot of the user's screen and return it as an image. Use
this tool anytime the user wants you to look at something they're doing.
"""
import pyautogui

View file

@ -1,6 +1,4 @@
"""
FastMCP Echo Server
"""
"""FastMCP Echo Server"""
from mcp.server.fastmcp import FastMCP

View file

@ -2,8 +2,7 @@
# dependencies = []
# ///
"""
FastMCP Text Me Server
"""FastMCP Text Me Server
--------------------------------
This defines a simple FastMCP server that sends a text message to a phone number via https://surgemsg.com/.

View file

@ -1,5 +1,4 @@
"""
Example FastMCP server that uses Unicode characters in various places to help test
"""Example FastMCP server that uses Unicode characters in various places to help test
Unicode handling in tools and inspectors.
"""
@ -10,8 +9,7 @@ mcp = FastMCP()
@mcp.tool(description="🌟 A tool that uses various Unicode characters in its description: á é í ó ú ñ 漢字 🎉")
def hello_unicode(name: str = "世界", greeting: str = "¡Hola") -> str:
"""
A simple tool that demonstrates Unicode handling in:
"""A simple tool that demonstrates Unicode handling in:
- Tool description (emojis, accents, CJK characters)
- Parameter defaults (CJK characters)
- Return values (Spanish punctuation, emojis)

View file

@ -1,5 +1,4 @@
"""
FastMCP Weather Example with Structured Output
"""FastMCP Weather Example with Structured Output
Demonstrates how to use structured output with tools to return
well-typed, validated data that clients can easily process.