Skip to content

Migrating from yapf to ruff format #17657

@hmellor

Description

@hmellor

Motivation.

We would like to transition vLLM from yapf to ruff format. This will give us:

  • Increased line length
  • Better formatting style which is more effectively enforced by tooling rather than by maintainers
  • Fewer formatting tools fighting eachother

Proposed Change.

We plan to make this change gradually using the following process.

If we are converting directory x:

  • In x, we add a local pyproject.toml which:
    • overrides ruff's line length to 88 (it's own default)
    • removes the deprecated type ignores
    • enables isort in ruff
    • enables formatting of code in docstrings (good for the API docs)
  • We add x to the list of files to run ruff-format on in .pre-commit-config.yaml
  • We add x to the list of ignores in the yapf and isort config in the root pyproject.toml

Here is the list of PRs used to make the transition:

Metadata

Metadata

Assignees

Labels

RFCkeep-openPrevents stale label being applied

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions