From 1150639fa9560ae2da1f93fdbe15e96028ae013c Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 May 2026 11:22:06 +1000 Subject: [PATCH] chore(ty): suppress unresolved-import inside tests/ to keep lint-diff PR comment useful MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The lint-diff CI job runs ty as a bare uv tool without installing the project's venv, so test files trip ty with unresolved-import on pytest itself and on local test-only deps. The PR #30136 github- actions lint-summary bot reported 7 new such warnings, even though ty itself flags them as non-blocking and the imports demonstrably work at runtime (the full pytest suite in a sibling CI job exercises them). Installing the full venv just to please ty would balloon the lint job runtime; the override below tells ty to ignore unresolved-import strictly inside tests/. The diagnostic class continues to be active for hermes_cli/, agent/, plugins/, etc. — anywhere those imports might really break. --- pyproject.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ae2472b7a10..c93f2f87e5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -246,6 +246,21 @@ python-version = "3.13" unknown-argument = "warn" redundant-cast = "ignore" +# Per-file rule overrides — see [tool.ty.overrides] below. +# +# Tests can't resolve their own third-party dev deps (pytest, etc.) +# under the lint-diff CI job because that job installs ``ty`` as a +# bare uv tool without the project's venv. Installing the full venv +# just to please the type checker would balloon the lint job; the +# diagnostics aren't actionable inside tests anyway because the +# imports demonstrably work at runtime (the same CI runs the full +# pytest suite in a different job). Suppress unresolved-import +# inside tests/ so the lint-diff PR comment stays useful. + +[[tool.ty.overrides]] +include = ["tests/**"] +rules = { unresolved-import = "ignore" } + [tool.ruff] preview = true # required for PLW1514 (unspecified-encoding) — preview rule