chore(ruff): the acceptance was whatever the default happened to be [skip-docs]
`uv sync --frozen` resolved ruff 0.15.22 and the tree read clean. A loose install resolves 0.16.6, under which the SAME untouched code reports 148 findings -- 4 more than round 9 counted, because this round added four files. All of them are new rules rather than new defects: 0.16 widened the default rule set to whole families (YTT, ASYNC, PL, ISC, C4, UP, B, SIM, FURB, ...). (`[skip-docs]` is for CLAUDE.md, which a lint-configuration change does not reach. README's developer section IS updated in this commit.) THE DEFECT IS NOT THE 148, IT IS THAT NOBODY CHOSE THEM. `[tool.ruff]` set only `line-length` and `target-version`, so the acceptance was ruff's default, and the tree stayed green only as long as the lockfile froze an old ruff. `select` is now written down: `E4`, `E7`, `E9`, `F` (the historical default), `I` because this tree already keeps imports sorted, and `RUF100` so a `noqa` that has stopped meaning anything is caught rather than left as decoration. Pin `ruff>=0.9` -> `ruff>=0.16.6,<0.17`. Per rule, before -> after: RUF100 50 -> 0, I001 20 -> 0, ISC004 19, PLW1510 8, C408 8, EXE001 6, RUF007 5, PLE2515 4, UP031 3, B017 3, and fourteen more with 2 or fewer -- the families out of the declared set are 0 by selection, and 148 is the number to start from if they are adopted, which is a separate decision and not one to take inside a version-pin commit. 57 were auto-fixed; one E402 was reintroduced by the import-sorting fix merging a block away from its `noqa`, and got the directive back rather than a bare one. `S` IS MEASURED OUT, NOT ASSUMED OUT: it reports 2657 `S101` on a suite whose every assertion is an `assert`, and `S603` flags 19 subprocess calls of which one was ever marked -- selecting it buys 18 suppressions and no defect. Two `noqa` directives naming non-selected rules were dropped with that reason recorded in the configuration instead. THE TWO FILES 0.16 WOULD REFORMAT ARE MARKDOWN, NOT PYTHON: `README.md` and `docs/2026-09-08-blindsone-below-k-k2.md`. 0.16 formats fenced Python inside markdown, and both blocks are RECORDS -- the second is a quotation of `COST_VOCABULARY` as it stood when that measurement was taken. Reformatting a quotation makes it stop being one, so markdown is excluded from the formatter and `ruff format --check .` stays in the acceptance over `.py`. `tools/okf_consume_measure.py` is fenced by the order as run-not-edited, so its three findings are exempted by path with the reason and the debt named, and its bytes are untouched. THE LOCKFILE TRAP IS CLOSED, NOT AVOIDED. `uv.lock` predated the `[ocr]` extra, so any unlocked resolve wrote that extra's transitive tree back into it -- 681 insertions over 4 deletions, twice now, and round 9 recorded the cause as `uv run` OUTSIDE the project when it is `uv run` without `--frozen` INSIDE it. The relock is complete for every declared extra (703 insertions, 26 deletions), and measured after it, an unfrozen `uv run` leaves the file alone. `ruff check src tests tools`, `ruff format --check .` (0.16.6), `mypy src` over 21 files and 1535 tests, all green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
191de89f41
commit
36c201cc8a
37 changed files with 843 additions and 105 deletions
|
|
@ -119,7 +119,12 @@ extract = ["pdfplumber>=0.11.10,<0.12", "pypandoc-binary==1.17"]
|
|||
ocr = ["rapidocr>=3.9,<4", "onnxruntime>=1.20,<2", "pypdfium2>=4,<6"]
|
||||
|
||||
[dependency-groups]
|
||||
dev = ["pytest>=8", "mypy>=1.14", "ruff>=0.9"]
|
||||
# ruff PINNED TO A RANGE, not floored at an ancient version. `ruff>=0.9` let
|
||||
# the lockfile decide which ruff ran, and a frozen 0.15.22 is what made this
|
||||
# tree read green while 0.16.6 found 148 things in it. The floor is now the
|
||||
# version the acceptance was measured under, and the ceiling is the next minor,
|
||||
# because 0.16 is itself the release that widened the default rule set.
|
||||
dev = ["pytest>=8", "mypy>=1.14", "ruff>=0.16.6,<0.17"]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/llm_ingestion_okf"]
|
||||
|
|
@ -141,6 +146,55 @@ packages = ["src/llm_ingestion_okf"]
|
|||
line-length = 100
|
||||
target-version = "py310"
|
||||
|
||||
# THE RULE SET IS DECLARED, and that is the whole repair rather than a
|
||||
# preference. Until 2026-09-09 this table set only `line-length` and
|
||||
# `target-version`, so the ACCEPTANCE was whatever ruff's default happened to
|
||||
# be -- and the tree read green only because `uv.lock` froze ruff at 0.15.22.
|
||||
# Upgrading to 0.16.6 turned up 148 findings in code nobody had touched, all of
|
||||
# them new rules rather than new defects: 0.16 widened the default set to
|
||||
# include whole families (YTT, ASYNC, PL, ISC, C4, UP, B, SIM, FURB, ...). An
|
||||
# undeclared `select` means every ruff release silently redefines what "clean"
|
||||
# means, which is exactly how a formatter gate went red unseen.
|
||||
#
|
||||
# WHAT IS HERE AND WHY. The historical default (`E4`, `E7`, `E9`, `F`), plus
|
||||
# `I` because this tree already keeps its imports sorted, plus `RUF100` so a
|
||||
# `noqa` that has stopped meaning anything is caught rather than left as
|
||||
# decoration.
|
||||
#
|
||||
# WHAT IS NOT HERE, MEASURED RATHER THAN ASSUMED. `S` (bandit) reports **2657**
|
||||
# `S101` on a test suite whose every assertion is an `assert`, and `S603`
|
||||
# reports **19** subprocess calls of which one was ever marked -- selecting it
|
||||
# would buy 18 new suppressions and no defect. The remaining families the 0.16
|
||||
# default adds are a real question and a separate one: they are worth adopting
|
||||
# deliberately, not inside a version-pin commit, and the number to start from
|
||||
# is the 148 above.
|
||||
[tool.ruff.lint]
|
||||
select = ["E4", "E7", "E9", "F", "I", "RUF100"]
|
||||
|
||||
# ONE FILE IS EXEMPT, and it is a fence rather than a judgement about the code.
|
||||
# `tools/okf_consume_measure.py` is a measurement instrument that published
|
||||
# figures were produced with, and the order that authorised this cleanup fenced
|
||||
# it explicitly: it is RUN, not edited, so its bytes stay as the numbers were
|
||||
# taken. Its three findings are a stale `noqa: E402` twice over and an import
|
||||
# order -- none of them a defect, all of them the same churn this upgrade
|
||||
# produced everywhere else, and all of them to be cleaned the next time the
|
||||
# fence is lifted. Named here rather than left to make the gate red for a
|
||||
# reason nobody could see.
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tools/okf_consume_measure.py" = ["I001", "RUF100"]
|
||||
|
||||
# MARKDOWN IS NOT FORMATTED, and this is a decision the 0.16 upgrade forced.
|
||||
# ruff 0.16 formats fenced Python inside markdown. Two files here would change
|
||||
# under it, and both are RECORDS rather than source: `README.md`'s call example
|
||||
# and `docs/2026-09-08-blindsone-below-k-k2.md`'s QUOTATION of `COST_VOCABULARY`
|
||||
# as it stood when that measurement was taken. Reformatting a quotation makes it
|
||||
# stop being one, and this repository publishes reproduction blocks that a
|
||||
# reader is meant to be able to compare against what was run. The formatter's
|
||||
# job here is Python source; `ruff format --check .` is part of the acceptance
|
||||
# and stays so, over `.py`.
|
||||
[tool.ruff.format]
|
||||
exclude = ["*.md"]
|
||||
|
||||
[tool.mypy]
|
||||
strict = true
|
||||
python_version = "3.10"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue