How to specify custom ty.toml configs?

オープン
#7 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

pre-commit フックのエントリポイントから始め、引数が uv check に渡され、その後 ty に渡される仕組みを追跡します。--config-file と TY_CONFIG_FILE がどのように処理されるかを確認し、2 つのフック設定で異なる ty.toml ファイルを選択する方法を判断します。手動フックと通常のフックが、unresolved-import と unresolved-reference に対して要求された動作を持つ個別の設定を使用できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Hi! Thanks for this pre-commit hook. I'd like to setup two different hooks, one that runs manual and checks unresolved imports and references (slow, requires me to build my C++/Python bindings), and one that ignores unresolved-import and unresolved-reference.

For that purpose I'd like to pass two different ty.toml config files to the pre-commit hooks, but it looks like uv check for not forward --config-file to ty and I don't think we can easily pass TY_CONFIG_FILE in the pre-commit hook config either.

Do you have a suggestion on how to proceed?

主要言語
Python
スター
166
フォーク
4
平均マージ
2時間 58分
マージ済み PR(30日)
2

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

astral-sh/ty-pre-commit のほかの issue

astral-sh/ty-pre-commit の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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