python / python/mypy

Number of source files reported can be confusing

Abierto
#7,518 1 comentario 2 reacciones 1 asignado Ver en GitHub

@JukkaL ya está trabajando en esto.

Desde el 16/9/2019.

needs discussion priority-0-high topic-usability
Lenguaje dominante
Python
Estrellas
20.6k
Forks
3.3k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

It's possible for mypy to report fewer source files than files with errors. Example:

Found 38 errors in 8 files (checked 2 source files)

This was surprising to me. It turns out that the number of source files only includes the files passed on the command line, and it doesn't include files found by following imports. It might be better to include all found files.

There are some open questions though:

  • Should stubs be included in the count? My intuition says that they should not be, at least stubs from typeshed, since they are usually not what the user wants to be checked.
  • What about PEP 561 inline typed files? Mypy doesn't report errors in these by default, so they aren't checked, strictly speaking. I'm not sure about this.

If we'd change "checked N source files" to "processed N source files", counting all .py files would seem like the logical thing to do (including PEP 561 inline typed files). However, 'processed' doesn't sound as nice as 'checked' to me.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.