Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng
#8 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
tooling

Hướng nghiên cứu

Tái hiện sự không khớp trong thiết lập đồ chơi bằng cách sử dụng pyproject.toml, .pre-commit-config.yaml và pre-commit run --all-files; so sánh với các lần chạy trực tiếp pyright và pyrefly check từ test. Theo dõi cách hook pyrefly-typecheck-system xử lý các tệp do pre-commit cung cấp. Hoàn thành khi pre-commit chỉ kiểm tra foo, nhất quán với project-includes, thay vì cũng kiểm tra bar.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
38
Fork
5
Merge trung bình
3 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.