Skip to content

Conversation

@felixweinberger
Copy link
Contributor

Summary

Adds the D212 ruff rule to enforce that multi-line docstring summaries start on the first line (Google-style).

Motivation and Context

Enforces consistent docstring formatting across the codebase. The Google convention requires the summary to be on the same line as the opening """:

# Good (D212 compliant)
def foo():
    """Do something useful.
    
    More details here.
    """

# Bad (D212 violation)  
def foo():
    """
    Do something useful.
    
    More details here.
    """

Fixes #1890

How Has This Been Tested?

  • uv run ruff check . passes
  • uv run pyright passes

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Kludex
Kludex previously approved these changes Jan 16, 2026
@felixweinberger felixweinberger enabled auto-merge (squash) January 16, 2026 14:48
@felixweinberger felixweinberger force-pushed the fweinberger/docstring-lint branch 3 times, most recently from e880422 to 6a640b0 Compare January 16, 2026 15:57
@felixweinberger felixweinberger force-pushed the fweinberger/docstring-lint branch from 6a640b0 to 0971cbb Compare January 16, 2026 15:59
@felixweinberger felixweinberger merged commit d41d0c0 into main Jan 16, 2026
26 checks passed
@felixweinberger felixweinberger deleted the fweinberger/docstring-lint branch January 16, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add lint rule to enforce Google-style docstrings

3 participants