Repository navigation
Conversation
anth-volk
added this pull request to stack #3888
October 13, 2026 13:29
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3907 +/- ##
===========================================
+ Coverage 47.62% 85.35% +37.73%
===========================================
Files 239 255 +16
Lines 13425 14762 +1337
Branches 2318 2524 +206
===========================================
+ Hits 6393 12600 +6207
+ Misses 6395 1411 -4984
- Partials 637 751 +114 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
anth-volk
force-pushed
the
ruff-docstrings
branch
from
October 13, 2026 16:56
376029d to
2aa2512
Compare
anth-volk
removed this pull request from stack #3888
October 13, 2026 19:26
anth-volk
added this pull request to stack #3917
October 13, 2026 19:26
anth-volk
force-pushed
the
ruff-docstrings
branch
from
October 14, 2026 13:52
2aa2512 to
c9d4357
Compare
anth-volk
force-pushed
the
ruff-docstrings
branch
3 times, most recently
from
October 14, 2026 18:08
f9c71e0 to
c14b631
Compare
anth-volk
force-pushed
the
ruff-docstrings
branch
8 times, most recently
from
October 15, 2026 00:06
31126f6 to
bfed2d6
Compare
anth-volk
force-pushed
the
ruff-docstrings
branch
3 times, most recently
from
October 15, 2026 17:21
3d9fa59 to
90d5fe9
Compare
anth-volk
force-pushed
the
ruff-docstrings
branch
from
October 16, 2026 05:40
90d5fe9 to
cf6ae51
Compare
anth-volk
force-pushed
the
ruff-docstrings
branch
from
October 16, 2026 06:45
cf6ae51 to
2172b9e
Compare
Run ruff check --fix for the pydocstyle (D) rules: put summaries on the first line, drop blank lines after function docstrings, and normalise blank lines around sections and closing quotes. Only docstring whitespace changes; the published OpenAPI documents and Pydantic JSON schemas are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests are exempt from the missing-docstring rules (D1) but not from the style rules, so give each flagged test and fixture docstring a one-line imperative summary followed by a blank line, describe the parameters the numpy-style sections left out, and correct the validate_country test class, which said 404 where the decorator returns 400. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docstrings to the Redis-backed runtime cache (its Protocols, the in-memory fake, claims and the household and reform-impact caches), the observability runtime and stage plans, and the gateway client and auth helpers. Each says what a reader cannot see from the signature: what a miss means, when entries are rejected, and which Redis behaviour a fake command emulates. Adding a docstring to the fake backend's get makes RET501 report its explicit return None, which stays and is suppressed with a reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docstrings to scripts/rules (the registry model, loader, resolver, validator and renderer), the quality-guard runner and migration guard, the migration baseline, mirroring and smoke-test scripts, the Alembic environments, and the .github helper scripts. Reword the rules tool's noun-phrase function summaries into the imperative and give its multi-line summaries a separating blank line. scripts/rules is the canonical copy of a tool shared byte-for-byte with policyengine-sim-api, and the argparse help taken from module docstrings is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docstrings to the v1 SQLAlchemy models and connection settings, the congressional-district metadata, the v2 catalog publication records and staging, the household and policy migration qualification, the v2 migration target settings, and the v2 SQLModel tables and their enums. The table docstrings say what a row represents: what makes it unique, whether it is immutable, what owns it and what is deleted with it. Pydantic publishes a class docstring as the model's JSON-schema description, so these tables' schemas gain descriptions; none of them is in the published OpenAPI document. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docstrings to the v2 resource services (households, policies, user-households and user-policies), the metadata catalog service, and the comparison-run, simulation and report contracts: their sessions, database connectors, transformations, validators and types. They say what each read returns when nothing matches, which writes are deduplicated or idempotent, which typed errors are raised, and how the limit + 1 over-fetch drives has_more. Pydantic publishes class docstrings as JSON-schema descriptions. The metadata result types appear in the published OpenAPI document, so their docstrings are written for API consumers; the simulation and report types are the versioned Stage 12 worker contracts, so theirs describe what each message means to producer and consumer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docstrings to the native route dependencies (one contract line per Protocol method), the health, metadata and specification routers, the v2 metadata route builders and their shared read_resource helper, and the v2 request, document and response models and their methods. Pydantic publishes a model's class docstring as its JSON-schema description, so the response and document models in the OpenAPI document now carry descriptions written for API consumers: what each object represents, that households and policies are immutable and deduplicated, and how to page through results. Route functions, whose docstrings FastAPI would publish as operation descriptions, are unchanged, and so are the documented paths and operations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add module, function and class docstrings to the Flask blueprints, the payload validators and utilities, and the top-level application, constants, country, SPM, migration-flag and query-parameter modules. Reword the existing error-handler, user-profile, policy and cache-key docstrings into one-line imperative summaries, complete the Args sections of get_policy, set_policy and validate_country (whose entry described the wrapper's argument instead of the decorator's), and drop the update_user_profile promise of a 403 for auth0_id edits, which the code never makes. Only validator methods on the published SPM and query-parameter models gained docstrings; their class docstrings are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docstrings to the v1 economy, household, policy, report, simulation and user services, their legacy-to-v2 mirroring helpers and the budget- window cache, including their Pydantic option, result and spec models. They say what a reader cannot see from the signature: which results are cached and how, which writes are mirrored to v2, what None means, and which errors are raised. Reword the existing summaries that ran on without a blank line or past 88 columns, correct get_economic_impact, which claimed to return a tuple, and replace the pass bodies of two exception classes with their new docstrings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Select the pydocstyle rules (D), keeping D211 and D212 of the two mutually exclusive pairs. Test files stay exempt from the missing-docstring rules (D1) but follow the docstring style rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two validator fixtures were the last D103 findings. The disabled cache backend's get() now ends at its docstring instead of suppressing RET501 on an explicit return None. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
api.quality.ruff-lint now lists D, and the rendered rules page and AGENTS.md Rules block are regenerated for the new tool hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run ruff check --fix for the pydocstyle (D) rules over the Stage 12A sign-in and user-association code: it drops the blank line after 87 function docstrings. Only docstring whitespace changes; the published OpenAPI documents and Pydantic JSON schemas are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SimulationRunSegments and SimulationRunProgress.to_dict get docstrings and the mock execution helper describes its run_progress argument: the ruff group 4 findings in the code #3916 added. The economy impact route's docstring now also says that a computing body carries the stage fields the Simulation Entrypoint reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dded Add docstrings to the bearer-token and Auth0 Management libraries, the shared association helpers, and the identity, account and legacy- reference services with their sessions, connectors, validators and types: 67 ruff group 4 findings in the code #3891 added. They say what the signature cannot: when a principal's user is provisioned and when a read leaves it absent, which typed errors are raised, how concurrent first sign-ins and lost provisioning races resolve, and what deleting an account removes in v2 and in Auth0. Two existing summaries become imperative (D401) with the same meaning. AccountUpdateInput's new class docstring does not reach the published OpenAPI document, whose AccountPatchRequest keeps its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docstrings to the user-household, user-policy, user-report and user-simulation services, sessions, connectors, transformations, validators and types: 88 ruff group 4 findings in the code #3891 added. They say that every operation acts for the session principal, that reads never provision a signed-out browser's user, which v1 references are checked before the v2 transaction, how a legacy id repoints an association to the v2 copy of a v1 record, and which typed errors are raised. Docstrings the stack added before #3891 changed this code now match it: row reads are owner-scoped, list filters include the legacy ids, and updates can repoint the association. The report provision, calibration, scorecard and validation models are request-body models, so their class docstrings become component descriptions in the published OpenAPI document; its structure is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docstrings to the account, user-report and user-simulation response models, the new route-dependency Protocol methods and the authentication error: 60 ruff group 4 findings in the code #3891 added. Response classes whose body was pass now hold their docstring instead. Pydantic publishes a model's class docstring as its JSON-schema description, so 34 /v2 OpenAPI components gain descriptions written for API consumers; no path, operation or schema structure changes, and no route function gained a docstring. The user-policy and user-household Protocol lines now say that each operation acts for the caller, that a policy patch can repoint the association through legacy_policy_id, and that a household is repointed through legacy_household_id rather than household_id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UserType and the user-association migration qualification get docstrings: 6 ruff group 4 findings in the code #3891 added. The saved household and policy tables now say they link a v2 record or a v1 legacy id, and the user table says that a standard user always has a primary country and that its sign-in identities are deleted with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
ruff-docstrings
branch
from
October 16, 2026 07:05
2172b9e to
29cbf71
Compare
This branch was successfully deployed
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 #3906
Summary
Phase 1 step 1.8, group 4: docstrings. Stacked on #3905.
selectgainsDand ignoresD203andD213, keepingD211(no blank line before a class docstring) andD212(summary on the first line). All 1,336 findings at the base are fixed: about 1,000 docstrings added or reworded across 229 Python files, committed by area (runtime cache and libraries, rules tool and scripts, data layer, v2 services, FastAPI routes and models, Flask routes and utilities, v1 services). Existing docstrings were reworded to say what the code actually does; one test docstring said 404 where the code returns 400.passand..., finds one other change, which is equivalent. In full:passnow have a docstring instead, because PIE790 flagspassafter a docstring....after their new docstring.get()drops its redundantreturn Noneinstead of suppressing RET501.noqa: D…anywhere. The two validator proof fixtures forapi.v2.validators-transformations-no-dbget one-line docstrings rather than a per-file ignore.description, and FastAPI copies a route docstring into the operation description. Compared with the base, withdescriptionkeys removed:/v2/openapi.jsonpreview.EconomicImpactResultreworded).scripts/rulesis byte-identical with sim again (tool sha256db83d5ad2aa4); sim adopts this PR's wording in Enable ruff docstring rules (D) policyengine-sim-api#779.api.quality.ruff-lintnow listsD.Testing
pytest tests/unit tests/contract, to_refactor and the dedupe integration test (themake testset): 2,411 passed.ruff checkandruff format --check(0.15.12) are clean repo-wide.🤖 Generated with Claude Code