python / python/mypy

Number of source files checked in output is misleading with -m specifiers

Open
#14,076 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Bug Report

I had a test directory with several files in it. When I switched from mypy test/ to mypy -m test, I found that the output at the result became a bit misleading:

-Found 80 errors in 2 files (checked 32 source files)
+Found 80 errors in 2 files (checked 3 source files)

To Reproduce

mkdir test
touch test/__init__.py test/a.py test/b.py
mypy test/
mypy -m test

Expected Behavior

I would expect the same output in both cases.
There are probably alternate acceptable behaviors - but this one is confusing.

Your Environment

  • Mypy version used: .990

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 running the reported reproduction with mypy test/ and mypy -m test using the listed commands. Trace how source files are counted for directory versus module arguments, then make the resulting summary consistent and verify that both commands report the same number of checked source files.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.