Repository navigation
Fix Ruff's docstring findings (D) - #63
Merged
Merged
Conversation
anth-volk
force-pushed
the
claude/ruff-docstrings
branch
2 times, most recently
from
November 2, 2026 15:07
3615de5 to
e0b0a06
Compare
- D209 and D202: Ruff's fixes put closing quotes on their own line and remove blank lines after function docstrings. - D101, D102, D103, D105 and D107: docstrings for the public classes, methods, functions, magic methods and __init__ methods that had none, describing what the code does. - D205, D401 and D404: one-sentence summaries in the imperative mood on the first line, with the rest of each docstring kept as its description. - Two docstrings replace a placeholder body (`pass` in BuildCompleted, `...` in GraphTransport's methods), which PIE790 would otherwise flag. With docstrings removed, every changed module's syntax tree matches the base branch's. - Ruff no longer ignores D. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…les them - TelemetryRecorder.transition_stage and StageTransition (interface): how each status is mapped, that an update for another stage finishes the current one first, that only a start makes a stage current (and is recorded as progress for the current stage), and that completed or failed ends the current stage. - calibration_progress and transition_calibration_progress (interface and emitter client): the service records only calibration_epoch events, moves to the calibrating stage only when the run is not there already, and the call returns True for an ignored event too. - GraphPublicationDelivery.__init__ names the three accepted local hosts; CollectorSession.invalidate gives the answers that come before token_rejected; StageDatasetBundle refuses a whitespace-only commit message; HuggingFaceSettings calls the file the event queue file. - The changelog fragment says only function and method summaries are imperative, as D401 checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
claude/ruff-docstrings
branch
from
November 2, 2026 16:49
e0b0a06 to
c3b68de
Compare
anth-volk
added a commit
that referenced
this pull request
Nov 2, 2026
#63 to #69 were rebased onto main after #58 merged, so this merge conflicted in the 14 files this branch had changed on top of #69. Each keeps this branch's side, plus the release's version bump in pyproject.toml; python -m scripts.rules render left the rules views as they were. The tree differs from 8776389 exactly by main's release (ff7d34b..a837a06). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
marked this pull request as ready for review
November 2, 2026 17:47
anth-volk
added a commit
that referenced
this pull request
Nov 3, 2026
#65 to #69 were rebased onto main after #63 merged, so this merge conflicted in the 13 files this branch had changed on top of #69. Each keeps this branch's side, plus the release's version bump in pyproject.toml; python -m scripts.rules render left the rules views as they were. The tree differs from 746e71e exactly by main's release (213b093..ed06bc2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #62
Part of #53.
What this does
The second of the pull requests stacked on #55 that fix the Ruff findings #55 leaves ignored: the 458 findings in
D(pydocstyle), after whichpyproject.tomlno longer ignores the family. Stacked on #58. Only docstrings change.D209(58) andD202(40): Ruff's fixes put closing quotes on their own line and remove the blank line after a function's docstring.D102(110),D103(44),D107(31),D101(14),D105(10): new docstrings for the public methods, functions,__init__methods, classes and magic methods that had none. Each was written from the code it describes: what it returns or changes, and the errors it raises where that matters. In tests,D1is exempt, as in both services, so these are all insrc,packages,scripts,toolsand the rootconftest.py.D401(81),D205(69),D404(1): summaries. Each summary is now one sentence in the imperative mood on the first line, and the rest of the old docstring is kept as its description. Test docstrings that began with only a review reference keep that text in full as the description, under a summary that says what the test checks.BuildCompleted(the interface's telemetry commands) the docstring replacespass, and in the OrreryGraphTransportprotocol it replaces..., since Ruff'sPIE790flags a placeholder next to a docstring. The host'sServiceModuleand the telemetryTransportprotocols keep their...bodies after the new docstrings, which Ruff accepts.default_handover_database_pathin the interface package said "spool database"; it now says "event queue file", as the emitter's documentation calls it.D. Every summary fits on the first line;D401checks the mood of function and method summaries only, so class, property and module summaries may be descriptive phrases.Four helper agents wrote the docstrings, one per area (the interface package; the Hugging Face, submissions and Orrery services; core, host and telemetry; tests, scripts and tools), from one brief. I checked their work as a whole: see the record below.
Test-first record
There is no red step, since nothing changes behaviour.
fbc62d2The docstringsruff check .andruff format --check .pass withDselected (exceptD203andD213, as in both services). All five guards pass withGITHUB_BASE_REF=main. With docstrings and placeholder bodies removed, the syntax tree of each of the 84 changed modules is identical to the base branch's, so no code, import, name or comment changed.f667e59,159f95fMerges of #55's round 2 and #58's round 1ruff check .andruff format --check .pass; the merged code needed no new docstrings.Review round 1:
0b3475aDocstring correctionstransition_stageandStageTransitionnow say how each status is handled: an update for another stage finishes the current one, only a start makes a stage current, and completed or failed ends the current stage. The calibration methods, in the interface and the emitter client, say that onlycalibration_epochevents are recorded, and that the move to the calibrating stage happens only when the run is not there already. Four smaller corrections; the fragment says only function and method summaries are imperative.ruff check .andruff format --check .pass; with docstrings removed, the 6 changed modules match the previous head.No test was run: the only changes to test files are docstrings, which the syntax-tree comparison shows. CI runs the tests.
CI
No workflow, trigger or script changes, and no environment variable or secret is read differently.
Release
The fragment is
changelog.d/ruff-docstrings.changed.md, a patch bump: merging releases the next patch version of both distributions, whose docstrings change.🤖 Generated with Claude Code