From 1ea301bdf4fd71079d0724ee746bc5448386cd81 Mon Sep 17 00:00:00 2001 From: jbloom Date: Thu, 20 Aug 2026 13:24:30 -0700 Subject: [PATCH] pin ruff and state the lint rules explicitly CI has been red on unchanged code. `ruff>=0.6` is unpinned, and ruff's *default* rule set widened in 0.16, so CI (which installed 0.16.4) reported 22 findings across 12 files while a local `.venv` on 0.15.12 reported none. Declare `[tool.ruff.lint] select` as ruff's pre-0.16 defaults -- the rules this project has actually been checked against -- so the selection is a project decision rather than whatever the installed ruff happens to default to, and pin ruff to `>=0.16,<0.17` so local and CI agree on the version. No source changes: main is clean under 0.16.4 once the selection is stated. Adopting the wider rule set is a separate question, left for its own change. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 8 ++++++++ pyproject.toml | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4088e44..4266c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Pin `ruff` to `>=0.16,<0.17` and state the lint rules explicitly with + `[tool.ruff.lint] select`. Ruff's *default* rule set widened in 0.16, which + turned CI red on unchanged code; the selection is now a project decision + rather than whatever the installed ruff defaults to. Development-only, no + effect on the package. + ## [0.3.0] - 2026-05-19 ### Added diff --git a/pyproject.toml b/pyproject.toml index 385f11b..6c23569 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ Issues = "https://github.com/jbloomlab/tree-annotated-plot/issues" [project.optional-dependencies] dev = [ "pytest>=8", - "ruff>=0.6", + "ruff>=0.16,<0.17", "black>=24", ] docs = [ @@ -58,3 +58,10 @@ target-version = ["py311"] [tool.ruff] target-version = "py311" + +[tool.ruff.lint] +# Ruff's default rule set is not stable across releases -- 0.16 broadened it, +# which turned CI red on unchanged code. State the rules we lint against so a +# ruff upgrade changes them only when we say so. These are ruff's pre-0.16 +# defaults, which is what this project has been checked against all along. +select = ["E4", "E7", "E9", "F"]