chore: replace darglint with pydoclint#64
Conversation
Migrate docstring validation from archived darglint to pydoclint per standards manifest (TOOL-007 requires pydoclint present, PC-006 requires the pydoclint hook, TOOL-013 requires darglint absent). Changes: - pyproject.toml dev dep: darglint removed, pydoclint>=0.8.4 added - pyproject.toml: [tool.darglint] replaced with [tool.pydoclint] (google style, arg type hints required, raises checked, returns/yields lenient) - .pre-commit-config.yaml: local darglint hook replaced with upstream jsh9/pydoclint hook (rev 88d83c94156c5e51a09938e77019f2c58e92ab58) - ci: skip: darglint entry removed (pydoclint runs from upstream repo) - uv.lock: darglint removed, pydoclint 0.8.4 + docstring-parser-fork added Note: 535 DOC violations found across 39 source files (see PR body for histogram). Docstring fixes are tracked as follow-up work. Hook config is correct; the violations are genuine docstring gaps to address. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 60 minutes. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (33)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
FIPS Compatibility Check -- PASSED
Status: PASSED |
Dependency ReviewThe following issues were found:
License Issuesuv.lock
OpenSSF Scorecard
Scanned Files
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Replaces the archived darglint docstring validator with pydoclint across dev tooling, per the standards manifest (TOOL-007, PC-006, TOOL-013). The PR is config-only and intentionally does not fix the 535 surfaced docstring violations — those are tracked as follow-up work.
Changes:
pyproject.toml: swaps dev depdarglint>=1.8.1→pydoclint>=0.8.4and replaces[tool.darglint]with[tool.pydoclint](Google style, arg type hints enforced, raises checked, returns/yields lenient)..pre-commit-config.yaml: replaces localdarglintsystem hook with upstreamjsh9/pydoclinthook pinned at SHA88d83c94…(0.8.4); dropsdarglintfromci.skip.uv.lock: removesdarglint; addspydoclint==0.8.4and its depdocstring-parser-fork==0.0.14.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pyproject.toml | Dev dep swap and replacement of [tool.darglint] with [tool.pydoclint] config block. |
| .pre-commit-config.yaml | Hook migrated to upstream pydoclint repo at pinned SHA; darglint removed from CI skip list. |
| uv.lock | Lockfile updated to drop darglint and add pydoclint + docstring-parser-fork. |
Resolve DOC109/110/105/203 across 28 source files by copying each type verbatim from the function signature annotation into the Google-style docstring (correct by construction; no types invented). - Args entries `name: desc` rewritten to `name (Type): desc` - Returns blocks gain the signature return annotation as the `Type:` prefix Reduces pydoclint violations from 535 to 76. Remaining items are structural (DOC301 init docstrings, DOC601-605 class attributes, DOC101/103 arg-set alignment, DOC106/107 missing signature hints, DOC503 raises naming) and are fixed in follow-up commits. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve the remaining structural pydoclint violations after the signature-type sync, taking every type verbatim from the class body annotation or function signature (no invented types): - DOC605/603/602/601: class `Attributes:` entries gain `(Type)` copied from class-body annotations; Settings attribute list corrected to match the actual fields (drop nonexistent redis_url, add the missing ones). - DOC301/101/103: exception and service classes (ProjectBaseError and subclasses, QueueClient, RedisStore, FileRouter, FileClassifier, FileTypeDetector, ConnectionManager) move their `__init__` argument docs into the class docstring `Args:` section and drop the `__init__` docstring, per pydoclint's allow-init-docstring=false default. - DOC106/107: annotate previously untyped signatures. Middleware `dispatch` call_next is typed RequestResponseEndpoint; the Sentry before_send processor takes dict[str, Any] params (matching the runtime objects) and is cast to ErrorProcessor at the registration site. - DOC503: Raises sections use the qualified jwt.InvalidTokenError to match the raise sites. - DOC404/203: None-returning/yielding functions drop or correct their Returns/Yields type to match the annotation. - fuzz harnesses: `data` arg documented as `(bytes)`. pydoclint now reports no violations on src/ and fuzz/, and the pydoclint pre-commit hook passes. basedpyright strict stays at 0 errors (warnings down from 258 to 250); ruff lint and format clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Performance Regression CheckStatus: PERFORMANCE OK
Threshold: +/-10% allowed regression ✅ Performance is within acceptable range. Additional Metrics
About Performance Regression TestingThis automated check compares
To reproduce locally: uv run --frozen python scripts/benchmark.py --iterations 1000 |
| from collections.abc import Awaitable, Callable | ||
|
|
||
| from fastapi import Request | ||
| from sentry_sdk._types import ErrorProcessor |
|


Summary
Migrates docstring validation from the archived darglint library to pydoclint per the updated standards manifest:
Changes made
pyproject.tomldev dep:darglint>=1.8.1removed;pydoclint>=0.8.4addedpyproject.toml:[tool.darglint]block replaced with[tool.pydoclint](google style, arg type hints enforced, raises checked, returns/yields sections lenient).pre-commit-config.yaml: localdarglinthook replaced with upstreamjsh9/pydoclinthook (rev88d83c94156c5e51a09938e77019f2c58e92ab58= 0.8.4)ci: skip:list:darglintentry removed; pydoclint is not added (it runs from upstream repo, not local)uv.lock: darglint removed; pydoclint 0.8.4 + docstring-parser-fork 0.0.14 addedDOC violation histogram (535 total; docstring fixes are follow-up work)
__init__docstring should be merged into class docstringAll 535 violations are genuine docstring gaps; none are suppressed. Posture: arg type hints required (DOC109/110), raises checked (DOC5xx), returns/yields sections lenient (DOC201/301 not enforced). Fixing the docstrings is tracked as follow-up work in a separate PR.
Posture
arg-type-hints-in-docstring = true: All documented args must include types.arg-type-hints-in-signature = true: Cross-checks signature types.skip-checking-raises = false: Raises sections are validated.require-return-section-when-returning-nothing = false: Lenient.require-return-section-when-returning-values = false: Lenient.require-yield-section-when-yielding-values = false: Lenient.