python / python/mypy

Semi-verbose flag that shows which files mypy analyzes

Open
#7,672 5 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs discussion topic-developer topic-usability
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Sometimes (example: #6385) it's useful to be able to see exactly which files mypy is processing. Currently the only way is to use -v and grep stderr for the word "Parsing".

Maybe this is common enough that we could spare a new command-line flag? It would print all the files for which a BuildSource object is created, and all the files that are reached by following imports (with some indicator of which is which).

The order in which files are printed should reflect the order in which they are processed (not the order in which they are specified).

I wouldn't mind adding extra info for each file (e.g. whether its cache entry is used), as long as it remains a single line per file.

Presumably there's also value in printing certain failures, e.g. modules which can't be found but for which no error message is printed (e.g. through --follow-imports=silent). But I would stop here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing -v output that reports "Parsing" on stderr, then inspect where BuildSource objects are created and where imports are followed. Done means a new command-line flag prints one line per directly specified or imported file in processing order, with an indicator distinguishing the two; verify the output with representative mypy runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.