Skip to content

chore: replace darglint with pydoclint#64

Open
williaby wants to merge 3 commits into
mainfrom
chore/replace-darglint-with-pydoclint
Open

chore: replace darglint with pydoclint#64
williaby wants to merge 3 commits into
mainfrom
chore/replace-darglint-with-pydoclint

Conversation

@williaby
Copy link
Copy Markdown
Contributor

Summary

Migrates docstring validation from the archived darglint library to pydoclint per the updated standards manifest:

  • TOOL-007: pydoclint must be present
  • PC-006: pydoclint pre-commit hook required
  • TOOL-013: darglint must be absent

Changes made

  • pyproject.toml dev dep: darglint>=1.8.1 removed; pydoclint>=0.8.4 added
  • pyproject.toml: [tool.darglint] block replaced with [tool.pydoclint] (google style, arg type hints enforced, raises checked, returns/yields sections lenient)
  • .pre-commit-config.yaml: local darglint hook replaced with upstream jsh9/pydoclint hook (rev 88d83c94156c5e51a09938e77019f2c58e92ab58 = 0.8.4)
  • ci: skip: list: darglint entry 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 added

DOC violation histogram (535 total; docstring fixes are follow-up work)

Code Count Description
DOC203 128 Return type in docstring does not match annotation
DOC110 114 Not all docstring args have type hints
DOC109 114 Docstring arg list missing type hints
DOC105 112 Arg type hints in docstring do not match signature
DOC301 16 __init__ docstring should be merged into class docstring
DOC605 13 Attribute type hints in class docstring do not match
DOC103 13 Docstring args differ from function signature
DOC101 13 Docstring contains fewer args than signature
DOC107 4 Docstring has more args than signature
DOC603 2 Yield type mismatch
DOC503 2 Raises section lists exceptions not raised
Other 5 DOC106, DOC404, DOC601, DOC602

All 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.

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>
Copilot AI review requested due to automatic review settings May 31, 2026 04:26
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Warning

Review limit reached

@williaby, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5d5c790a-4dfe-469e-8b43-cfbe3e0359d8

📥 Commits

Reviewing files that changed from the base of the PR and between fe8761e and d5c1c77.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (33)
  • .pre-commit-config.yaml
  • fuzz/fuzz_file_classifier.py
  • fuzz/fuzz_file_detector.py
  • fuzz/fuzz_jwt_validation.py
  • pyproject.toml
  • src/rag_processor/api/batch.py
  • src/rag_processor/api/health.py
  • src/rag_processor/api/ingest.py
  • src/rag_processor/api/user.py
  • src/rag_processor/auth/cloudflare.py
  • src/rag_processor/auth/dependencies.py
  • src/rag_processor/auth/models.py
  • src/rag_processor/core/cache.py
  • src/rag_processor/core/config.py
  • src/rag_processor/core/exceptions.py
  • src/rag_processor/core/pipeline_config.py
  • src/rag_processor/core/sentry.py
  • src/rag_processor/main.py
  • src/rag_processor/middleware/correlation.py
  • src/rag_processor/middleware/security.py
  • src/rag_processor/models/batch.py
  • src/rag_processor/models/job.py
  • src/rag_processor/queue/client.py
  • src/rag_processor/queue/jobs.py
  • src/rag_processor/queue/redis_store.py
  • src/rag_processor/routing/classifier.py
  • src/rag_processor/routing/detector.py
  • src/rag_processor/routing/router.py
  • src/rag_processor/utils/logging.py
  • src/rag_processor/utils/time_utils.py
  • src/rag_processor/websocket/connection_manager.py
  • src/rag_processor/websocket/events.py
  • src/rag_processor/websocket/router.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/replace-darglint-with-pydoclint

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

FIPS Compatibility Check -- PASSED

Metric Count
Errors 0
Warnings 0
Info 3

Status: PASSED

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
See the Details below.

License Issues

uv.lock

PackageVersionLicenseIssue Type
pydoclint0.8.4NullUnknown License
Denied Licenses: GPL-2.0, GPL-3.0

OpenSSF Scorecard

PackageVersionScoreDetails
pip/docstring-parser-fork 0.0.14 UnknownUnknown
pip/pydoclint 0.8.4 UnknownUnknown

Scanned Files

  • uv.lock

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 31, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​pydoclint@​0.8.4100100100100100

View full report

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dep darglint>=1.8.1pydoclint>=0.8.4 and replaces [tool.darglint] with [tool.pydoclint] (Google style, arg type hints enforced, raises checked, returns/yields lenient).
  • .pre-commit-config.yaml: replaces local darglint system hook with upstream jsh9/pydoclint hook pinned at SHA 88d83c94… (0.8.4); drops darglint from ci.skip.
  • uv.lock: removes darglint; adds pydoclint==0.8.4 and its dep docstring-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.

williaby and others added 2 commits May 30, 2026 21:56
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>
@github-actions
Copy link
Copy Markdown

✅ Performance Regression Check

Status: PERFORMANCE OK

Metric Baseline (main) PR Branch Change
p95_ms 2.51 2.76 +10.0%

Threshold: +/-10% allowed regression

✅ Performance is within acceptable range.

Additional Metrics

Metric Baseline PR Change
p50_ms 1.87 1.88 📈 0.5%
p95_ms 2.51 2.76 📈 10.0%
p99_ms 2.57 3.18 📈 23.9%
mean_ms 1.43 1.49 📈 4.8%
min_ms 0.06 0.06 📉 -1.8%
max_ms 2.58 3.96 📈 53.9%
throughput_ops 701.67 669.48 📉 -4.6%
total_iterations 500.00 500.00 ➡️ 0.0%
avg_p95_all_benchmarks_ms 0.99 1.06 📈 7.1%
avg_throughput_all_benchmarks_ops 968439.86 1016047.21 📈 4.9%
About Performance Regression Testing

This automated check compares p95_ms on this PR against the main branch baseline.

  • Regression Threshold: 10%
  • Warmup Iterations: 5
  • Benchmark Iterations: 50
  • Baseline Source: generated

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
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
57.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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.

3 participants