[PR #22576] [MERGED] feat: add ruff linter & formatter #65620

Closed
opened 2026-05-06 11:30:27 -05:00 by GiteaMirror · 0 comments
Owner

📋 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: devHead: riff


📝 Commits (4)

  • a4e7096 chore: add ruff linter with base config
  • 921ad4d ci: add ruff pre-commit hook
  • 4573448 ci: add ruff github actions workflow
  • 95e9ffb ci: 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

  • Target branch: dev
  • Description: See changelog below
  • Changelog: See below
  • Documentation: No user-facing changes — tooling config only
  • Dependencies: Added ruff>=0.15.5 as dev dependency. Ruff is the standard Python linter/formatter used by FastAPI, Pydantic, Hugging Face, etc.
  • Testing: Ran ruff check backend and ruff format --check backend locally
  • Agentic AI Code: Not AI-generated code. Config files only.
  • Code review: Self-reviewed
  • Design & Architecture: No architectural changes
  • Git Hygiene: 3 atomic commits, rebased on dev
  • Title Prefix: feat

Changelog Entry

Description

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


🔄 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>
GiteaMirror added the pull-request label 2026-05-06 11:30:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#65620