check-typing: ty 0.0.98+ fails on the renamed rule `unresolved-import` (now `import-not-found`)

已关闭 适合新手
#2,046 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
94/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

阅读 justfile:872 中的 check-typing recipe,以及 .github/workflows/main.yml:70 中安装 ty 的步骤。使用 recipe 当前的忽略列表重现警告,然后按照 issue 的描述替换已重命名的规则。使用 ty 0.0.99 运行检查,并确认检查通过且没有关于已重命名规则的诊断。

由索引模型根据 Issue 内容生成。

描述

What happens

ty 0.0.97 renamed the rule unresolved-import to import-not-found (astral-sh/ruff#29960). Since 0.0.98, ty warns when the old name is used (astral-sh/ruff#30024):

warning[renamed-rule]: Rule `unresolved-import` has been renamed to `import-not-found`

check-typing still passes --ignore unresolved-import (justfile:872), and ty exits with 1 on this warning. So the check fails without any real type error. CI installs ty unpinned (uv tool install ty, .github/workflows/main.yml:70), so every PR is red on quality-checks since ty 0.0.98.

Evidence

Run on master with ty 0.0.97, 0.0.98 and 0.0.99 and the recipe's exact --ignore list:

  • 0.0.97: passes (no warning);
  • 0.0.98 / 0.0.99 as-is: Found 1 diagnostic, which is the renamed-rule warning, exit 1;
  • 0.0.99 with --ignore import-not-found instead: All checks passed!.

All other rule names in the recipe are valid in 0.0.99; this is the only rename in ty 0.0.97 to 0.0.99.

Fix

In justfile:872:

-        --ignore unresolved-import \
+        --ignore import-not-found \

No pin needed: CI keeps using the latest ty.

主要语言
Python
星标
2.5k
派生
768
平均合并
3 小时 45 分钟
30 天内合并 PR
18

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

crossbario/autobahn-python 的其他 Issue

查看 crossbario/autobahn-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。