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

オープン 初心者向け
#2,046 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
94/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

justfile:872 の check-typing レシピと .github/workflows/main.yml:70 の ty インストール手順を読む。レシピの現在の除外リストで警告を再現し、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
フォーク
766
平均マージ
3時間 25分
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

crossbario/autobahn-python のほかの issue

crossbario/autobahn-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。