chore(ty): suppress unresolved-import inside tests/ to keep lint-diff PR comment useful

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.
This commit is contained in:
Ben 2026-05-25 11:22:06 +10:00
parent 02c933aedc
commit 1150639fa9

View file

@ -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