Skip to content

build(deps-dev): bump ruff to 0.16.1 and sync the pre-commit rev - #582

Merged
sumithr merged 1 commit into
mainfrom
build/ruff-0-16-1
Aug 3, 2026
Merged

sumithr merged 1 commit into
mainfrom
build/ruff-0-16-1

Conversation

@sumithr

@sumithr sumithr commented Aug 3, 2026 •

Copy link
Copy Markdown
Owner

Supersedes Dependabot #575, which bumped pyproject.toml only.

The comment sitting directly above the pin says to move it and the ruff-pre-commit rev: together in one commit. CI installs ruff via pip install -e ".[dev,vertex]" and never opens .pre-commit-config.yaml, so a one-sided bump leaves git commit and the required CI job running different ruff versions, which is exactly the drift #570 fixed.

Changes

File From To
pyproject.toml:128 ruff==0.16.0 ruff==0.16.1
.pre-commit-config.yaml:39 rev: v0.16.0 rev: v0.16.1

Verification

0.16.1 introduces no formatting change against this tree, so no fixture churn:

ruff --version                 ruff 0.16.1
ruff check .                   All checks passed!
ruff format --check .          336 files already formatted
git diff -- tests/scenarios/   (empty)

The graded conformance fixtures are untouched, which is the property that matters after the 0.16.0 markdown-formatting change.

@sumithr
sumithr merged commit e037904 into main Aug 3, 2026
33 checks passed
@sumithr
sumithr deleted the build/ruff-0-16-1 branch August 3, 2026 13:12
sumithr added a commit that referenced this pull request Aug 3, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.60.3](v0.60.2...v0.60.3)
(2026-08-03)


### Bug Fixes

* **deps-dev:** bump promptfoo and override transitive advisories to
clear npm audit ([#579](#579))
([eea45a1](eea45a1))
* **deps:** floor mcp at 1.28.1 to close three transport advisories
([#578](#578))
([567714e](567714e))


### Build System

* **deps-dev:** bump ruff to 0.16.1 and sync the pre-commit rev
([#582](#582))
([e037904](e037904))
* **deps-dev:** update tree-sitter requirement from <0.26,>=0.25
to >=0.25,<0.27
([#489](#489))
([81d3d49](81d3d49))
* **deps:** bump actions/setup-node from 6 to 7
([#553](#553))
([32129a0](32129a0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <release-please[bot]@users.noreply.github.com>
sumithr added a commit that referenced this pull request Aug 3, 2026
## Summary

Removes `tests/test_toolchain_pins.py`, the guard added in #570, and the
block of prose in `.pre-commit-config.yaml` that was standing in for it.
The ruff hooks are executable: the way to know they are right is to run
them, not to read an essay about them or a test asserting their shape.

The guard cost more defects than it caught. Successive review passes
found a hole in it every round, and never once found a hole in the
config it guarded:

| Round | Hole in the guard |
|---|---|
| 1 | repo root resolved into mutmut's `mutants/` copy, raising
`FileNotFoundError`, tripping `-x` and reporting all six modules as 0
killed |
| 2 | imported `identify` and shelled out to `ruff`, neither of which
exists in the isolated pre-push hook environments |
| 3 | probed the first tracked `.toml`, which is `pyproject.toml`, the
one name ruff special-cases, so it could not detect the over-selection
it existed to catch |
| 4 | allowlisted hook keys but left permitted VALUES unchecked, so
`args: [--exit-zero]` passed every assertion |

One comment line survives, on `rev:`, because nothing executable covers
it: the required `ruff check + format` job installs ruff from
`pyproject.toml` and never opens `.pre-commit-config.yaml`, so a rev
that drifts from the pin puts contributors on a different formatter and
stays quiet until an unrelated PR goes red.

## What stays

Nothing that fixed a real problem is removed. The config is untouched
apart from the comments:

- `ruff==0.16.1` in `pyproject.toml` and the matching `rev: v0.16.1`,
which is what turned the required check green on `main`
- `types_or: [python, pyi, jupyter, markdown]` on `ruff-format`, so a
drifting Markdown fence is caught at commit time
- the files-scoped `ruff-check-config` entry, so an invalid ruff config
fails at commit time instead of in CI

## How it was verified

Each behaviour the deleted prose described, confirmed by running the
hook against a real file rather than asserting it:

```
pre-commit run ruff-check-config --files pyproject.toml ruff.toml
  ->  ruff check (ruff config files)...Passed

pre-commit run ruff-check-config --files tests/fixtures/repo_map/rust_context_crate/Cargo.toml
  ->  ruff check (ruff config files)...(no files to check)Skipped

pre-commit run ruff-format --files tests/scenarios/CONFORMANCE.md
  ->  ruff format...Passed
```

and each one failing on an injected defect, so the passes above are not
vacuous:

```
# `select = [..., "NOT-A-RULE"]` in ruff.toml
pre-commit run ruff-check-config --files ruff.toml
  ->  Failed, exit code 2
      Cause: Unknown rule selector `NOT-A-RULE` in `select` from ruff.toml

# `x   =    1` added to a Python fence in CONFORMANCE.md
pre-commit run ruff-format --files tests/scenarios/CONFORMANCE.md
  ->  Failed, files were modified by this hook
      1 file reformatted
```

That second one is the whole reason `ruff-format` overrides `types_or`:
with the upstream python/pyi/jupyter list the same file reports `(no
files to check)Skipped`.

Both injections were reverted, confirmed by `git status`.

Full gates, on the pinned ruff 0.16.1 (rebased onto #582, which bumped
the pin from 0.16.0; the conflict was in the comment this PR deletes,
resolved by keeping the new rev):

- `uv run ruff check .`: All checks passed
- `uv run ruff format --check .`: 335 files already formatted (252 `.py`
+ 83 `.md`, one fewer `.py` after the deletion)
- `uv run mypy`: no issues in 74 source files
- `uv run pytest -q`: 100% coverage held; only
`test_built_wheel_contains_py_typed_marker` fails, the known `No module
named pip` in a uv venv, which the CI `pip install` jobs cover
- `pre-commit validate-config`: exit 0
- No dangling references to the deleted module remain (`grep -rn
toolchain_pins` is empty)

Mutation gate, dispatched on this branch because the diff touches
`tests/**/*.py` (run 30819133472, Linux, 4m27s):

```
| Module            | Baseline killed | Current killed | Survivors | Verdict |
| knowledge_loaders | 472             | 472            | 0         | OK      |
| rules             | 41              | 41             | 0         | OK      |
| standards         | 25              | 25             | 0         | OK      |
| tdm_validation    | 203             | 203            | 0         | OK      |
| coverage_models   | 87              | 87             | 0         | OK      |
| report_builder    | 793             | 793            | 0         | OK      |
All modules: kill counts >= baseline and 0 survivors. Strict gate passed.
```

## Residual risk, accepted deliberately

Stated plainly rather than buried, because it is the whole trade this PR
makes.

**Nothing now compares `pyproject.toml`'s `ruff==` pin with
`.pre-commit-config.yaml`'s `rev:`.** Verified by injecting `rev:
v0.15.0` and running every gate: the full suite passes, `pre-commit
validate-config` exits 0, no test reads `rev:` at all, and the required
lint job runs `python -m ruff` installed from `pyproject.toml` without
ever opening the config. A one-sided bump reaches `main` silently and
surfaces later as a red required check on somebody's unrelated PR. That
is the #570 failure, and it is now guarded by a comment instead of a
test.

The trade is accepted because the guard cost four rounds of its own
defects and caught none in the config, and because the real bump path
already does the right thing: #582 bumped `ruff` to 0.16.1 and synced
the `rev:` in one commit, touching exactly `pyproject.toml` and
`.pre-commit-config.yaml`.

Two related notes from the adversarial pass, neither a defect in this
PR:

- Weakening a *different* hook property (`types_or: [python]` on
`ruff-format`, or `stages: [manual]`) is not caught by CI *at the moment
of weakening* either. CI catches the drifting file it lets through, on
the next push. The deleted test never asserted hook shapes, so this is
unchanged by this PR.
- `tests/test_mutmut_subprocess_exclusions.py:274` globs every
`tests/test_*.py`, so deleting one changes its parametrize set. Inert
here: the deleted module was never in the mutmut `--ignore` list, all
six ignore paths still resolve, and the module runs 148 passed / 0
failed on this branch.

## Checklist

- [x] PR title follows [Conventional
Commits](https://www.conventionalcommits.org/)
- [x] Tests pass locally (`pytest`) and lint/type checks are green
(`pre-commit run --all-files`, `python -m mypy`)
- [ ] Added or updated tests covering the change (n/a: this PR REMOVES a
test; the hook behaviours are verified by executing the hooks, above,
and enforced by the required `ruff check + format` job)
- [x] Updated the relevant docs in this same PR
- [x] No breaking changes (or they are called out above)

---------

Co-authored-by: sumithr <sumith.ramsookbhai@johnlewis.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant