Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#8 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Riproduci la discrepanza nella configurazione di prova usando pyproject.toml, .pre-commit-config.yaml e pre-commit run --all-files; confrontala con esecuzioni dirette di pyright e pyrefly check da test. Traccia come l’hook pyrefly-typecheck-system gestisce i file forniti da pre-commit. Il lavoro è completato quando pre-commit controlla solo foo, in conformità con project-includes, invece di controllare anche bar.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
36
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.