Skip to content

[Docs] Add pydocstyle to the ruff rules - #52136

Merged
hmellor merged 21 commits into
vllm-project:mainfrom
hmellor:add-pydocstyle
Sep 16, 2026
Merged

hmellor merged 21 commits into
vllm-project:mainfrom
hmellor:add-pydocstyle

Conversation

@hmellor

@hmellor hmellor commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Enables the D ruleset in ruff and fixes the resulting violations across the codebase.

Config

D100–D107 are ignored, so this does not require a docstring on anything that lacks one today. Six more rules are ignored because their remaining violations were either impossible to autofix or actively wrong to autofix:

Rule Why skipped
D205, D400, D415 All treat a summary sentence that merely wraps as summary-plus-body. The autofix appends periods to list items.
D401, D404 Flag idiomatic noun-phrase docstrings on properties and attributes.
D301 Churn-only (r""" prefixes).

Plus ignore-var-parameters = true (no *args/**kwargs descriptions required) and a tests/** ignore for D417, since test params are mostly pytest fixtures.

Changes

The bulk is autofix output for the mechanical rules (D209, D212, D200, D202, D413, and friends). On top of that, by hand:

  • ~290 Args: entries written across 88 files for D417, mostly in fused_moe, attention backends, and multimodal models. Several were format bugs rather than missing docs: numpy-style Parameters/---------- blocks that ruff's Google parser can't read at all.
  • 807 trailing periods for D400/D415, applied only where D205 doesn't co-fire, so no list items were punctuated.
  • 37 E501 regressions fixed. These were introduced by the D212 autofix collapsing wrapped summaries onto line 1 and pushing them past 88 chars.
  • A handful of one-offs: D210, D402, D418, D419.

Incidental fixes picked up along the way: typos (videoand, output_dytpe, the m odel) and stale docs naming parameters that no longer exist.

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@mergify

mergify Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--52136.org.readthedocs.build/en/52136/

@mergify mergify Bot added documentation Improvements or additions to documentation ci/build deepseek Related to DeepSeek models frontend llama Related to Llama models multi-modality Related to multi-modality (#4194) mistral Related to Mistral models new-model Requests to new models performance Performance-related issues quantization qwen Related to Qwen models gpt-oss Related to GPT-OSS models kimi labels Aug 13, 2026
@mergify mergify Bot added the k3 label Aug 13, 2026
@mergify mergify Bot added the nvidia label Aug 13, 2026
@mergify mergify Bot added rocm Related to AMD ROCm intel-gpu Related to Intel GPU labels Aug 13, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Aug 13, 2026
@mergify mergify Bot added the cpu Related to CPU backends label Aug 13, 2026
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor

hmellor commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #84198 for commit 5272327b8a93.

hmellor and others added 2 commits September 16, 2026 10:39
Conflicts were resolved by taking main's content for every conflicted file,
then re-running `ruff check --fix` and `ruff format` under the pydocstyle
config so the docstring changes are regenerated from main's text. The
remaining non-autofixable violations (D417/D402/E501) were fixed by hand,
reusing the wording this branch had already written where it applied.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor

hmellor commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #89319 for commit 64019d2de29f.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor

hmellor commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

Copy link
Copy Markdown

❌ This PR is 2 commits behind upstream main. Your branch must contain every commit currently on upstream main. No new CI build was started. Merge or rebase onto the latest main, then rerun /ci run. To test this branch at your own risk, use /ci run --allow-stale.

@hmellor

hmellor commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #89328 for commit eda0f3d077f4.

@mergify

mergify Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Hi @hmellor, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Resolve conflict in tests/v1/kv_connector/unit/test_kv_load_failure_recovery.py
by taking main's rewrite (the docstring this branch reformatted was removed
upstream), and fix new D200/D212 violations in code merged from main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor

hmellor commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #89346 for commit 3a73e1d052d3.

@shen-shanshan shen-shanshan mentioned this pull request Sep 17, 2026
3 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-docs ci/build cohere Related to Cohere models cpu Related to CPU backends deepseek Related to DeepSeek models dflash documentation Improvements or additions to documentation DSv4 DSv4.1 Related to DeepSeek-V4.1 models frontend glm gpt-oss Related to GPT-OSS models inkling intel-gpu Related to Intel GPU k3 kimi kv-cache-manager kv-connector llama Related to Llama models minimax mistral Related to Mistral models mrv2 Model Runner V2 specific multi-modality Related to multi-modality (#4194) new-model Requests to new models nvidia performance Performance-related issues quantization qwen Related to Qwen models ray anything related with ray ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm scheduler speculative-decoding structured-output tool-calling torch.compile vllm-ir vLLM IR: intermediate representation and kernel registration

Projects

Status: Done
Status: Done
Status: Done
Status: Done
Status: Done
Status: Done
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants