python / python/mypy

Error location show incorrect file.

Aperta
#16,175 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug priority-0-high topic-usability
Lingua principale
Python
Stelle
20.6k
Fork
3.3k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Following up on issue https://github.com/HypothesisWorks/hypothesis/issues/3753: the failing example in that issue always shows the test.py file as the originating file, which is incorrect:

test.py:1139:50: error: Cannot use a covariant type variable as a parameter  [misc]

The file containing the failing type check is called from test.py.

To Reproduce

See the referenced issue: install Hypothesis and mypy using the mentioned versions, and run the example.

Expected Behavior

Error location should show the file that contains the failing type check.

Actual Behavior

Error location shows the file file that contains the call to the failing type check.

Your Environment

  • Mypy version used: 1.5.1
  • Mypy command-line flags: mypy --show-traceback --config-file pyproject.toml test.py
  • Mypy configuration options from pyproject.toml:
    
     [tool.mypy]
     # mypy_path =
     # exclude =
     show_error_codes = true
     show_column_numbers = true
     check_untyped_defs = true
     incremental = false
     strict_equality = true
     warn_return_any = true
     warn_redundant_casts = true
     warn_unreachable = true
     warn_unused_configs = true
     warn_unused_ignores = true
     disallow_untyped_calls = true
     disallow_untyped_defs = true
     disallow_incomplete_defs = true
     disallow_untyped_decorators = true
     disable_error_code = []
     
     [[tool.mypy.overrides]]
     module = [
     ]
     ignore_missing_imports = true
    
  • Python version used: python 3.10.13 (main, Aug 25 2023, 01:44:57) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin

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.

Direzione di ricerca

Inizia con la riproduzione nell’issue di Hypothesis indicata, utilizzando test.py, pyproject.toml e il comando mypy e le versioni riportati. Traccia il modo in cui viene selezionata la posizione del controllo dei tipi che fallisce invece della posizione del chiamante, quindi verifica che la diagnostica identifichi il file contenente il controllo che fallisce.

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

Valutazione

Stack tecnologico
python
Ambito
compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.