Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Migrating from pyright to pyrefly for pre-commit silently turns off type checking for files outside `include`/`project-includes`

クローズ
#8 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

pyproject.toml、.pre-commit-config.yaml、および pre-commit run --all-files を使用して toy setup で不一致を再現し、test から直接実行した pyright および pyrefly check と比較します。pyrefly-typecheck-system hook が pre-commit から渡されたファイルをどのように処理するかを追跡します。完了条件は、pre-commit が project-includes と整合して foo のみをチェックし、bar もチェックしないことです。

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

説明

If you migrate from pyrefly to pyright for pre-commit, it's very easy to accidentally turn off type checking for some directories. Here's a toy set-up, based on the set-up of a real-world project (pytorch/helion). Essentially, my project has two directories, foo and bar, and the type-checking config says to check only foo:

test/
|--pyproject.toml
|--.pre-commit-config.yaml
|--foo/
|--bar/

Here's the contents of pyproject.toml:

[tool.pyright]
include = ["foo"]

[tool.pyrefly]
project-includes = ["foo"]

And the contents of .pre-commit-config.yaml:

repos:
-   repo: https://github.com/facebook/pyrefly-pre-commit
    rev: 0.0.1
    hooks:
      - id: pyrefly-typecheck-system
        name: Pyrefly (type checking)

-   repo: https://github.com/RobertCraigie/pyright-python
    rev: v1.1.407
    hooks:
      - id: pyright
        language: system

Running either pyright or pyrefly check inside test produces the same behavior: foo is checked. However, running pre-commit run --all-files causes pyright to check all files as specified, including the contents of bar. Pyrefly still checks only foo.

主要言語
Python
スター
37
フォーク
5
平均マージ
3分
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

似ている issue

Python の issue をもっと見る

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

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