What
.lintrunner.toml comments examples/**/*.py out of the mypy scope, leaving only examples/arm and
examples/openvino. The mypy lint job is the one gate that runs on every pull request, and it
would have caught a bug that shipped on main and took a separate PR to fix.
Concretely, #22298 fixes a read of a config field that no longer exists. Running the exact pinned
mypy 1.14.1 from requirements-lintrunner.txt with the repo's .mypy.ini against that expression:
error: "BackendConfig" has no attribute "mps" [attr-defined]
Clean after the fix. So the broken PR would have gone red in seconds. The macOS job that did catch it
lives in trunk.yml, which does not start for a change to that directory, so the bug reached main
and failed there first.
What it would cost
Not free. examples/models/llama/export_llama_lib.py alone reports 20 mypy errors today, 14 of them
not import-not-found, and the lint job runs over all files in scope, so they would all have to be
fixed in the same change. One of those errors looks like a real bug rather than a typing nit.
Filing rather than doing it, since it is a much larger change than the fix that surfaced it, and the
per-directory cost should probably be assessed by whoever owns examples/.
Found while reviewing #22298.
What
.lintrunner.tomlcommentsexamples/**/*.pyout of the mypy scope, leaving onlyexamples/armandexamples/openvino. The mypy lint job is the one gate that runs on every pull request, and itwould have caught a bug that shipped on
mainand took a separate PR to fix.Concretely, #22298 fixes a read of a config field that no longer exists. Running the exact pinned
mypy 1.14.1 from
requirements-lintrunner.txtwith the repo's.mypy.iniagainst that expression:Clean after the fix. So the broken PR would have gone red in seconds. The macOS job that did catch it
lives in
trunk.yml, which does not start for a change to that directory, so the bug reachedmainand failed there first.
What it would cost
Not free.
examples/models/llama/export_llama_lib.pyalone reports 20 mypy errors today, 14 of themnot
import-not-found, and the lint job runs over all files in scope, so they would all have to befixed in the same change. One of those errors looks like a real bug rather than a typing nit.
Filing rather than doing it, since it is a much larger change than the fix that surfaced it, and the
per-directory cost should probably be assessed by whoever owns
examples/.Found while reviewing #22298.