From e9b0243eee4ce9ebc3437c731090bff2ac20f847 Mon Sep 17 00:00:00 2001 From: Keith Adler <271127604+keithadler@users.noreply.github.com> Date: Sat, 15 Aug 2026 21:14:00 -0700 Subject: [PATCH] Pin the lint contract: explicit rule set, bounded ruff CI began failing on unchanged code. ruff 0.16 widened its *default* rule selection (isort, pylint, flake8-simplify, flake8-blind-except, RUF), and this project had never declared a selection, so it silently inherited the new one. 13 errors appeared in code that had not been touched since it last passed. Declare select = ["E4", "E7", "E9", "F"] - the set this code was actually written against, under which it is clean - and bound ruff to <0.17 so the lint contract cannot change again without a deliberate bump. Not fixed by rewriting the flagged code: the blind `except Exception` around eval() and pslq() is deliberate, since a linter must degrade to None rather than crash on arbitrary user input. Co-Authored-By: Claude Opus 5 --- pyproject.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1c5f009..dbc3ff8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ ] [project.optional-dependencies] -dev = ["pytest>=8", "ruff>=0.4", "flake8>=7"] +dev = ["pytest>=8", "ruff>=0.4,<0.17", "flake8>=7"] [project.scripts] exact = "exact_linter.cli:main" @@ -42,3 +42,11 @@ testpaths = ["tests"] [tool.ruff] line-length = 100 target-version = "py310" + +[tool.ruff.lint] +# State the rule set explicitly rather than inheriting ruff's default, which +# is not stable across releases: 0.16 widened it to include isort, pylint, +# flake8-simplify and flake8-blind-except, and CI started failing on code +# that had not changed. The blind `except Exception` around eval()/pslq() is +# deliberate - a linter must degrade to None, never crash on user input. +select = ["E4", "E7", "E9", "F"]