Migrating from pyright to pyrefly for pre-commit silently turns off type checking for files outside `include`/`project-includes`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·