Skip to content

[pre-commit.ci] pre-commit autoupdate - #1693

Closed
pre-commit-ci[bot] wants to merge 3 commits into
masterfrom
pre-commit-ci-update-config
Closed

pre-commit-ci[bot] wants to merge 3 commits into
masterfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci

@pre-commit-ci pre-commit-ci Bot commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Apr 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.43%. Comparing base (4e10030) to head (38d4185).
⚠️ Report is 307 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1693      +/-   ##
==========================================
+ Coverage   86.87%   89.43%   +2.55%     
==========================================
  Files          56       73      +17     
  Lines        6532    10618    +4086     
==========================================
+ Hits         5675     9496    +3821     
- Misses        857     1122     +265     
Flag Coverage Δ
pytests 89.43% <ø> (+2.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 6eec861 to fe16fdb Compare April 20, 2026 18:23
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from fe16fdb to eb33c7e Compare April 27, 2026 18:47
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from eb33c7e to 606ded9 Compare May 11, 2026 18:27
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from ddf979a to 64a17f9 Compare May 25, 2026 18:43
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from b797e47 to 0e66088 Compare June 8, 2026 18:32
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 0e66088 to ee5896b Compare June 15, 2026 18:38
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from e2adae1 to d285d87 Compare June 29, 2026 18:34
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 53dc551 to 38d4185 Compare July 20, 2026 18:40
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 38d4185 to ff594d8 Compare July 27, 2026 18:35
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 8dbefe3 to 0697abb Compare August 3, 2026 18:45
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from a71a6bd to 8053ada Compare August 10, 2026 18:50
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 0d3b5b8 to ff60780 Compare August 24, 2026 18:50
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.8 → v0.16.5](astral-sh/ruff-pre-commit@v0.15.8...v0.16.5)
- [github.com/pre-commit/mirrors-mypy: v1.19.1 → v2.3.1](pre-commit/mirrors-mypy@v1.19.1...v2.3.1)
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from e65841c to bca7af9 Compare August 31, 2026 19:01
chrisjsewell added a commit that referenced this pull request Sep 2, 2026
…hem (#1805)

`ruff` was pinned in two places that disagreed — `v0.15.8` in
`.pre-commit-config.yaml`, `0.14.11`
in the `ruff` dependency group — so `uv run prek run` and `tox -e
ruff-check` have been running
different linters. `mypy` is pinned in two places too. This moves ruff
to **0.16.5** and mypy to
**2.3.1** in both places each, and adds the one config line that makes a
ruff version bump mean
"a new ruff", not "a new rule set".

**ruff 0.16 replaced its default rule set.** In an empty project, `ruff
check --isolated
--show-settings` reports **59** default rules on 0.15.8 and **413** on
0.16.5. This project only
ever set `extend-select`, never `select`, so its base set has always
been whatever the installed
ruff happened to default to. On today's `master` that means:

| ruff | `ruff check` findings |
| --- | --- |
| 0.14.11 (dependency group) | 0 |
| 0.15.8 (hook) | 0 |
| 0.16.5, unpinned base set | **298** |
| 0.16.5, base set pinned | 148 |
| 0.16.5, base set pinned, as merged here | **0** |

The bump is only a version bump if `select` is pinned, so the first
commit does that:

```toml
select = ["E4", "E7", "E9", "F"]   # ruff's pre-0.16 default
```

At the versions in force at that commit it is a byte-for-byte no-op
(same 259 enabled rules, same
"All checks passed!", same 326 files already formatted). What it buys is
that the enabled set is now
a property of this file rather than of the pinned version. Enabled-rule
set diff, old config on
0.15.8 vs the config in this PR on 0.16.5 (`ruff check --show-settings`,
counting
`linter.rules.enabled`): **259 -> 262, gained exactly `RUF036`,
`RUF063`, `RUF068`, lost none** —
all three were preview-only in 0.15.8 and stabilised in 0.16. `ISC004`
stabilised with them and is
added to `extend-ignore` next to the existing `ISC001`: all 35
occurrences here are deliberately
wrapped string literals and its only fix is unsafe.

So the entire lint surface of this bump is `RUF036
none-not-at-end-of-union`, 113 findings, all safe
autofixes, applied machine-wise with `ruff check --select RUF036 --fix`
followed by `ruff format`.
Every one is `None | X` -> `X | None`: identical at runtime and to every
type checker, already the
prevailing spelling here, and never evaluated at all, since these
modules use `from __future__
import annotations`. `git diff -w` is the same as `git diff` — there is
no reformatting hiding in
it.

**Why #1693 goes red in all 13 Core cells and this does not.** That same
RUF036 autofix wave
rewrote `constraints_results: None | Mapping[str, Mapping[str, bool]]`
to `Mapping[...] | None` in
`sphinx_needs/data.py`. `tests/test_data.py::test_consistent`
cross-checks each `NeedsCoreFields`
entry against its `TypedDict` annotation by string-matching the raw
`ForwardRef` text, and while its
scalar branches listed both union orders, its *container* branches only
listed `None | dict[` /
`None | Mapping[` — so the reordered annotation fell into the
non-optional branch and asserted
`"object"` against `["object", "null"]`. One brittle test, no runtime
behaviour involved; this PR
teaches the container branches both orders (optional case tested first,
so it cannot be swallowed)
and the suite is green.

**Why #1693's Lint job stays red as well.** Of the 298 findings the
unpinned bump produces, **151
are not autofixable** — `BLE001` 43, `PLW1510` 30, `TRY004` 20,
`DTZ005`/`TRY002` 4 each, and so on.
The bot force-pushes a partially-fixed tree, and no amount of re-running
clears the rest.

**And one thing #1693 does silently.** `E402`
(module-import-not-at-top-of-file) is in ruff's
pre-0.16 default set and *not* in 0.16's, along with 17 others (`E401
E402 E7xx E711-E714 E721 E731
E741-E743 F403 F405 F406 F722`). So on that branch E402 stopped being
enforced and `RUF100
unused-noqa` then offered to delete all twelve `# noqa: E402`
suppressions in `docs/conf.py` as
unused — lint coverage lost, plus a twelve-site re-annotation for
whoever wants it back. Pinning
`select` keeps both the rule and the suppressions:

```
ruff check --isolated --select RUF100 docs/conf.py        ->  12x "Unused `noqa` (non-enabled: E402)"
ruff check --isolated --select RUF100,E402 docs/conf.py   ->  All checks passed!
```

**The ruleset expansion is deliberately deferred.** Those 151 findings
are a real backlog worth
reviewing — but rule by rule, in its own PR, not as a side effect of a
version pin. The `select` pin
is precisely what turns that into a clean opt-in: adopting 0.16's
defaults will then be a legible
one-line diff with its own reviewable consequences.

`ruff format` in 0.16 also formats python code blocks embedded in
markdown, which brings `AGENTS.md`
and `tests/conformance/needflow/README.md` into its scope.
`[tool.ruff.format] exclude = ["*.md"]`
keeps it out — same reasoning as the existing yamlfmt
`^tests/conformance/` exclude, since that
corpus is shared byte-for-byte with ubCode and checksummed in its own
manifest. Without the exclude,
`ruff format` rewrites 25 lines of `AGENTS.md` on this branch.

**mypy 2.3.1** is folded in because its two pins have to move together:
1.19.1 *requires* the
`# type: ignore[literal-required]` in `compile_validator` and 2.3.1
rejects it as unused, so
splitting the change would force a bridging `[literal-required,
unused-ignore]` into the tree and a
follow-up to take it out again. Moving both pins in one commit makes it
a plain deletion. mypy 2.3.1
reports nothing else: no new error classes, no deprecation warnings, no
config migration.

Two follow-ups this PR deliberately does not do:

- The mypy hook's `additional_dependencies` and the `mypy` dependency
group are maintained by hand
and have already drifted apart — the hook carries `minijinja~=2.15` and
the dependency group does
not, so `uv run prek run mypy` and `tox -e mypy` type-check against
different environments. It is
pre-existing and orthogonal to a version bump; the fix is one line (add
`minijinja~=2.15` to the
  group) and belongs in its own PR.
- Routine hook autoupdates should be owned by a scheduled `prek
autoupdate` job rather than by
pre-commit.ci reopening a PR every release; that is a separate change.
With `select` pinned, such
  updates are finally safe to take.

This supersedes #1693, which can be closed.
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