From 30dd6bf6d37a84a281559715b80810d52472d56c Mon Sep 17 00:00:00 2001 From: Jamie Nelson Date: Mon, 31 Aug 2026 18:06:51 +1000 Subject: [PATCH] chore(ruff): pin ruff hook and dependency to 0.14.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `.pre-commit-config.yaml` pinned `ruff-pre-commit` at v0.16.5 while `uv.lock` resolved ruff 0.14.8, so the hook and CI ran different ruff versions against the same files. Measured: with the 0.16.5 hook and the 0.14.8 lock, `prek run --all-files` deletes the justified `# noqa: PLC0415` suppressions in `packages/ensure_uv/version.py` (rewriting one into the 0.16-only `# ruff: ignore[import-outside-top-level]` spelling) and then reports the PLC0415 violations it just unsuppressed. Bumping the dependency up to 0.16.5 does not fix it: 0.16.5 deletes its own suppressions under `unsafe-fixes = true` and the gate stays red with the same 16 errors. So the hook is pinned down to the locked version instead, matching the mkapidocs precedent. `ruff` also moves from `>=0.14.8` to `==0.14.8` so the locked version cannot float away from the hook rev on the next `uv lock --upgrade`. Note that the `mxr/sync-pre-commit-deps` hook configured here cannot police this: its source hardcodes `SUPPORTED = frozenset(('black', 'flake8', 'mypy'))` and it only rewrites `additional_dependencies` entries inside `.pre-commit-config.yaml` — it never reads `pyproject.toml` or `uv.lock`. Keeping the two in step remains manual. Verified: `uv run prek run --all-files` passes with a clean tree. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01QJeBLNA9ybmQvv5REMDkrc --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c637716..c6ad761 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,7 +53,7 @@ repos: # Python formatting and linting - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.5 + rev: v0.14.8 hooks: - id: ruff name: Lint Python with ruff diff --git a/pyproject.toml b/pyproject.toml index 3599ecf..603461a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dev = [ "hatch-vcs>=0.5.0", "hatchling>=1.27.0", "prek>=0.2.20", - "ruff>=0.14.8", + "ruff==0.14.8", "toml-sort>=0.24.3", "ty>=0.0.75", "uv-sort>=0.6.1", diff --git a/uv.lock b/uv.lock index 6df59fa..20081b9 100644 --- a/uv.lock +++ b/uv.lock @@ -70,7 +70,7 @@ dev = [ { name = "hatch-vcs", specifier = ">=0.5.0" }, { name = "hatchling", specifier = ">=1.27.0" }, { name = "prek", specifier = ">=0.2.20" }, - { name = "ruff", specifier = ">=0.14.8" }, + { name = "ruff", specifier = "==0.14.8" }, { name = "toml-sort", specifier = ">=0.24.3" }, { name = "ty", specifier = ">=0.0.75" }, { name = "uv-sort", specifier = ">=0.6.1" },