Tighten comments and docstrings repo-wide#3022
Draft
maxisbey wants to merge 1 commit into
Draft
Conversation
Cut comment and docstring volume roughly in half across src, tests, examples, and docs_src: removed comments that restate the adjacent code, leftover development narration, section banners, and self-evident Args/Returns blocks, and compressed the remaining docstrings to a Google-style summary line plus only the detail that earns its place. Kept (and tightened) the load-bearing content: Raises sections, deprecation and version-availability notes, spec/RFC/issue references, why-comments for non-obvious decisions, and all coverage pragmas. The generated mcp_types.v* wire modules are untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repo-wide comment and docstring cleanup: 22,938 → 13,592 comment+docstring lines (−41%, or −48% excluding the generated
mcp_types.v*modules, which are untouched). 434 files, +3,860/−13,549.Motivation and Context
Comment volume had crept up to the point of hurting readability: comments restating the adjacent code, leftover development narration, section banners, and docstrings with self-evident Args/Returns blocks. This pass makes comments concise, intentional, and useful — code should mostly document itself, with comments reserved for motivation and the non-obvious.
What was cut vs kept:
Raises:sections, deprecation and version-availability notes, and all coverage pragmas /type: ignore/noqadirectives.tests/interaction/keeps its suite conventions (raw-stream mechanism notes, divergence refs,Spec-mandated:/SDK-defined:classifications stay).How Has This Been Tested?
mainonly in comments/docstrings — no code changes anywhere in the diff.strict-no-coverclean;ruffandpyrightclean; README snippet check passes.Breaking Changes
None — no code changes. Some docstrings of public APIs are shorter (a few constructor usage examples moved out of docstrings; the docs cover usage).
Types of changes
Checklist
Additional context
Tool/prompt/resource docstrings that serve as protocol-visible descriptions, and strings asserted by tests, were treated as fixture data and left alone.
AI Disclaimer