feat: check type hints in CI against a baseline

Every signature carries annotations and nothing read them. mypy 1.18.2
over install.py and scripts/ reports 993 errors today, among them the
six pack helpers typed zipfile.ZipFile that every caller also hands a
PackRecord. The errors sit in mypy-baseline.txt and the schema job fails
on any error outside it, or on an entry that no longer occurs. Third-party
packages are left out so the result does not depend on the machine: 6 s
locally, run twice and on 3.12 and 3.13 with the same errors.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 14:47:20 +01:00
1 parent a99682beeb
commit b56ec21728
5 files changed
+1091

No files matched your search

+13
View File
@@ -488,6 +488,19 @@ wired to pull requests alone would guard the road nobody takes. The test job
with BIOS validation and auto-labeling too. Those two read pull request context
and stay behind an event guard.
The schema job also runs mypy over `install.py` and `scripts/`. The code
carried 993 type errors when the check started, so they sit in
`mypy-baseline.txt` and only a new one fails. An error the change removes fails
too until the baseline is synced, so the file never hides a later error that
reads the same:
```bash
pip install -e ".[dev]"
mypy > tmp/mypy.txt
mypy-baseline filter < tmp/mypy.txt # what CI runs
mypy-baseline sync < tmp/mypy.txt # after a fix, commit the new baseline
```
A push series collapses to the tip, so what a green run states is that the head
of main passes, not every commit under it.