The backend currently relies on black for formatting but has no linter configured. This means common code issues — unused imports, bare excepts, mutable default arguments, f-strings without placeholders, shadowed variables — go undetected and slip into the codebase silently.
Add [tool.ruff] configuration to pyproject.toml with a practical rule set (E, F, W, I, UP, etc.)
Replace black with Ruff's built-in formatter (full black compatibility, 10-100x faster)
Apply autofixes across the backend
I already have a working local branch with these changes and I'm ready to fully take this on and submit a PR.
Alternatives Considered
Keep black + add flake8/pylint — works but means maintaining multiple tools with separate configs. Ruff covers both in a single, faster package.
Status quo — leaves easily preventable bugs and inconsistencies uncaught.
Additional Context
Ruff is already adopted by FastAPI, Pydantic, Hugging Face Transformers, and other major Python projects. It's a single Rust-based tool that replaces black, isort, flake8, pyupgrade, and dozens of other plugins with near-instant execution.
Originally created by @ashm-dev on GitHub (Feb 20, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21641
### Problem Description
The backend currently relies on `black` for formatting but has no linter configured. This means common code issues — unused imports, bare excepts, mutable default arguments, f-strings without placeholders, shadowed variables — go undetected and slip into the codebase silently.
### Desired Solution
Add [Ruff](https://docs.astral.sh/ruff/) as both linter and formatter:
- Add `[tool.ruff]` configuration to `pyproject.toml` with a practical rule set (`E`, `F`, `W`, `I`, `UP`, etc.)
- Replace `black` with Ruff's built-in formatter (full `black` compatibility, 10-100x faster)
- Apply autofixes across the backend
I already have a working local branch with these changes and I'm ready to fully take this on and submit a PR.
### Alternatives Considered
- **Keep `black` + add `flake8`/`pylint`** — works but means maintaining multiple tools with separate configs. Ruff covers both in a single, faster package.
- **Status quo** — leaves easily preventable bugs and inconsistencies uncaught.
### Additional Context
Ruff is already adopted by FastAPI, Pydantic, Hugging Face Transformers, and other major Python projects. It's a single Rust-based tool that replaces `black`, `isort`, `flake8`, `pyupgrade`, and dozens of other plugins with near-instant execution.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @ashm-dev on GitHub (Feb 20, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21641
Problem Description
The backend currently relies on
blackfor formatting but has no linter configured. This means common code issues — unused imports, bare excepts, mutable default arguments, f-strings without placeholders, shadowed variables — go undetected and slip into the codebase silently.Desired Solution
Add Ruff as both linter and formatter:
[tool.ruff]configuration topyproject.tomlwith a practical rule set (E,F,W,I,UP, etc.)blackwith Ruff's built-in formatter (fullblackcompatibility, 10-100x faster)I already have a working local branch with these changes and I'm ready to fully take this on and submit a PR.
Alternatives Considered
black+ addflake8/pylint— works but means maintaining multiple tools with separate configs. Ruff covers both in a single, faster package.Additional Context
Ruff is already adopted by FastAPI, Pydantic, Hugging Face Transformers, and other major Python projects. It's a single Rust-based tool that replaces
black,isort,flake8,pyupgrade, and dozens of other plugins with near-instant execution.