[tool.ruff] configuration in pyproject.toml with base rule set (E, F, W, I, UP, C90, Q, ICN), single quotes, line-length = 120
ruff>=0.15.5 dev dependency
Pre-commit hook (.pre-commit-config.yaml) — runs ruff check --fix and ruff format on backend/
GitHub Actions workflow (.github/workflows/ruff.yml) — runs lint & format checks on PRs
Changed
N/A
Deprecated
N/A
Removed
N/A
Fixed
N/A
Security
N/A
Breaking Changes
N/A
Additional Information
Rule set is intentionally minimal. More rules (B, SIM, PERF, RUF, etc.) will be added incrementally in follow-up PRs after fixing existing violations.
No code was reformatted in this PR — config only.
Screenshots or Videos
N/A (no UI changes)
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/22576
**Author:** [@ashm-dev](https://github.com/ashm-dev)
**Created:** 3/11/2026
**Status:** ✅ Merged
**Merged:** 3/15/2026
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `riff`
---
### 📝 Commits (4)
- [`a4e7096`](https://github.com/open-webui/open-webui/commit/a4e7096971cf1f04fea41d6092f60b047c8776f9) chore: add ruff linter with base config
- [`921ad4d`](https://github.com/open-webui/open-webui/commit/921ad4da9b80e976f94fa0e9358ee6468ab43b6b) ci: add ruff pre-commit hook
- [`4573448`](https://github.com/open-webui/open-webui/commit/45734481684a78c4bd7bdd76160fb0adfa7ebbfc) ci: add ruff github actions workflow
- [`95e9ffb`](https://github.com/open-webui/open-webui/commit/95e9ffb9faba8e562cd16fdfcf3a837fd51e1c6f) ci: run ruff only on changed files
### 📊 Changes
**3 files changed** (+84 additions, -0 deletions)
<details>
<summary>View changed files</summary>
➕ `.github/workflows/ruff.yml` (+49 -0)
➕ `.pre-commit-config.yaml` (+8 -0)
📝 `pyproject.toml` (+27 -0)
</details>
### 📄 Description
# Pull Request Checklist
- [x] **Target branch:** `dev`
- [x] **Description:** See changelog below
- [x] **Changelog:** See below
- [x] **Documentation:** No user-facing changes — tooling config only
- [x] **Dependencies:** Added `ruff>=0.15.5` as dev dependency. Ruff is the standard Python linter/formatter used by FastAPI, Pydantic, Hugging Face, etc.
- [x] **Testing:** Ran `ruff check backend` and `ruff format --check backend` locally
- [x] **Agentic AI Code:** Not AI-generated code. Config files only.
- [x] **Code review:** Self-reviewed
- [x] **Design & Architecture:** No architectural changes
- [x] **Git Hygiene:** 3 atomic commits, rebased on `dev`
- [x] **Title Prefix:** `feat`
# Changelog Entry
### Description
- Add Ruff linter & formatter for backend Python code quality. Replaces the disabled `black`-based workflow. Ref: #21641, https://github.com/open-webui/open-webui/discussions/22462
### Added
- `[tool.ruff]` configuration in `pyproject.toml` with base rule set (`E`, `F`, `W`, `I`, `UP`, `C90`, `Q`, `ICN`), single quotes, `line-length = 120`
- `ruff>=0.15.5` dev dependency
- Pre-commit hook (`.pre-commit-config.yaml`) — runs `ruff check --fix` and `ruff format` on `backend/`
- GitHub Actions workflow (`.github/workflows/ruff.yml`) — runs lint & format checks on PRs
### Changed
- N/A
### Deprecated
- N/A
### Removed
- N/A
### Fixed
- N/A
### Security
- N/A
### Breaking Changes
- N/A
---
### Additional Information
- Rule set is intentionally minimal. More rules (`B`, `SIM`, `PERF`, `RUF`, etc.) will be added incrementally in follow-up PRs after fixing existing violations.
- No code was reformatted in this PR — config only.
### Screenshots or Videos
- N/A (no UI changes)
### Contributor License Agreement
- [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22576
Author: @ashm-dev
Created: 3/11/2026
Status: ✅ Merged
Merged: 3/15/2026
Merged by: @tjbck
Base:
dev← Head:riff📝 Commits (4)
a4e7096chore: add ruff linter with base config921ad4dci: add ruff pre-commit hook4573448ci: add ruff github actions workflow95e9ffbci: run ruff only on changed files📊 Changes
3 files changed (+84 additions, -0 deletions)
View changed files
➕
.github/workflows/ruff.yml(+49 -0)➕
.pre-commit-config.yaml(+8 -0)📝
pyproject.toml(+27 -0)📄 Description
Pull Request Checklist
devruff>=0.15.5as dev dependency. Ruff is the standard Python linter/formatter used by FastAPI, Pydantic, Hugging Face, etc.ruff check backendandruff format --check backendlocallydevfeatChangelog Entry
Description
black-based workflow. Ref: #21641, https://github.com/open-webui/open-webui/discussions/22462Added
[tool.ruff]configuration inpyproject.tomlwith base rule set (E,F,W,I,UP,C90,Q,ICN), single quotes,line-length = 120ruff>=0.15.5dev dependency.pre-commit-config.yaml) — runsruff check --fixandruff formatonbackend/.github/workflows/ruff.yml) — runs lint & format checks on PRsChanged
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
B,SIM,PERF,RUF, etc.) will be added incrementally in follow-up PRs after fixing existing violations.Screenshots or Videos
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.