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

View file

@ -1,3 +1 @@
"""
Tests for the MCP server auth components.
"""
"""Tests for the MCP server auth components."""

View file

@ -1,6 +1,4 @@
"""
Integration tests for MCP authorization components.
"""
"""Integration tests for MCP authorization components."""
import base64
import hashlib

View file

@ -1,6 +1,4 @@
"""
Test the elicitation feature using stdio transport.
"""
"""Test the elicitation feature using stdio transport."""
from typing import Any

View file

@ -448,8 +448,7 @@ def test_complex_function_json_schema():
def test_str_vs_int():
"""
Test that string values are kept as strings even when they contain numbers,
"""Test that string values are kept as strings even when they contain numbers,
while numbers are parsed correctly.
"""
@ -463,8 +462,7 @@ def test_str_vs_int():
def test_str_annotation_preserves_json_string():
"""
Regression test for PR #1113: Ensure that when a parameter is annotated as str,
"""Regression test for PR #1113: Ensure that when a parameter is annotated as str,
valid JSON strings are NOT parsed into Python objects.
This test would fail before the fix (JSON string would be parsed to dict)
@ -514,8 +512,7 @@ def test_str_annotation_preserves_json_string():
@pytest.mark.anyio
async def test_str_annotation_runtime_validation():
"""
Regression test for PR #1113: Test runtime validation with string parameters
"""Regression test for PR #1113: Test runtime validation with string parameters
containing valid JSON to ensure they are passed as strings, not parsed objects.
"""

View file

@ -1,5 +1,4 @@
"""
Integration tests for FastMCP server functionality.
"""Integration tests for FastMCP server functionality.
These tests validate the proper functioning of FastMCP features using focused,
single-feature servers across different transports (SSE and StreamableHTTP).