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

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python3
"""
MCP OAuth conformance test client.
"""MCP OAuth conformance test client.
This client is designed to work with the MCP conformance test framework.
It automatically handles OAuth flows without user interaction by programmatically
@ -89,8 +88,7 @@ class InMemoryTokenStorage(TokenStorage):
class ConformanceOAuthCallbackHandler:
"""
OAuth callback handler that automatically fetches the authorization URL
"""OAuth callback handler that automatically fetches the authorization URL
and extracts the auth code, without requiring user interaction.
This mimics the behavior of the TypeScript ConformanceOAuthProvider.
@ -101,8 +99,7 @@ class ConformanceOAuthCallbackHandler:
self._state: str | None = None
async def handle_redirect(self, authorization_url: str) -> None:
"""
Fetch the authorization URL and extract the auth code from the redirect.
"""Fetch the authorization URL and extract the auth code from the redirect.
The conformance test server returns a redirect with the auth code,
so we can capture it programmatically.
@ -148,8 +145,7 @@ class ConformanceOAuthCallbackHandler:
async def run_authorization_code_client(server_url: str) -> None:
"""
Run the conformance test client with authorization code flow.
"""Run the conformance test client with authorization code flow.
This function:
1. Connects to the MCP server with OAuth authorization code flow
@ -180,8 +176,7 @@ async def run_authorization_code_client(server_url: str) -> None:
async def run_client_credentials_jwt_client(server_url: str) -> None:
"""
Run the conformance test client with client credentials flow using private_key_jwt (SEP-1046).
"""Run the conformance test client with client credentials flow using private_key_jwt (SEP-1046).
This function:
1. Connects to the MCP server with OAuth client_credentials grant
@ -223,8 +218,7 @@ async def run_client_credentials_jwt_client(server_url: str) -> None:
async def run_client_credentials_basic_client(server_url: str) -> None:
"""
Run the conformance test client with client credentials flow using client_secret_basic.
"""Run the conformance test client with client credentials flow using client_secret_basic.
This function:
1. Connects to the MCP server with OAuth client_credentials grant

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python3
"""
Simple MCP client example with OAuth authentication support.
"""Simple MCP client example with OAuth authentication support.
This client connects to an MCP server using streamable HTTP transport with OAuth.

View file

@ -1,5 +1,4 @@
"""
SSE Polling Demo Client
"""SSE Polling Demo Client
Demonstrates the client-side auto-reconnect for SSE polling pattern.