{"action":"opened","issue":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/935","labels_url":"https://api.github.com/repos/JukkaL/mypy/issues/935/labels{/name}","comments_url":"https://api.github.com/repos/JukkaL/mypy/issues/935/comments","events_url":"https://api.github.com/repos/JukkaL/mypy/issues/935/events","html_url":"https://github.com/JukkaL/mypy/issues/935","id":111710077,"number":935,"title":"Accept a list of files, or whole packages, to typecheck","user":{"login":"gnprice","id":28173,"avatar_url":"https://avatars.githubusercontent.com/u/28173?v=3","gravatar_id":"","url":"https://api.github.com/users/gnprice","html_url":"https://github.com/gnprice","followers_url":"https://api.github.com/users/gnprice/followers","following_url":"https://api.github.com/users/gnprice/following{/other_user}","gists_url":"https://api.github.com/users/gnprice/gists{/gist_id}","starred_url":"https://api.github.com/users/gnprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnprice/subscriptions","organizations_url":"https://api.github.com/users/gnprice/orgs","repos_url":"https://api.github.com/users/gnprice/repos","events_url":"https://api.github.com/users/gnprice/events{/privacy}","received_events_url":"https://api.github.com/users/gnprice/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-15T21:20:58Z","updated_at":"2015-10-15T21:20:58Z","closed_at":null,"body":"I'd love to be able to hand mypy a whole library, or a program where it's not totally obvious what the entry point is (or if there is a single entry point), and have it typecheck the whole thing.\r\n\r\nFor example in mypy itself, to typecheck `mypy/` with all the Python files that make it up. We used to have `tests.py` as a standin for this, but `runtests.py` is more complicated and `mypy runtests.py` doesn't actually check everything. I can use `mypy -m mypy.main`, but that's getting into details about how the code is laid out.\r\n\r\nOne interface for this would be to just list a bunch of files as positional arguments to `mypy`. More convenient in many cases would be to say \"here's a directory and typecheck everything underneath it\".\r\n\r\nGiven the mypy example, actually, where `mypy/test/data/` contains Python files that aren't part of the program, maybe the right option to have there is \"here's a *Python package* and typecheck everything that's part of it\". So e.g.\r\n```\r\n$ mypy -p mypy\r\n```\r\nwould look up `mypy` for import, see that it's a package module, go find all the other files next to its `__init__.py` and the directories that themselves contain `__init__.py`, and recurse. Because there's no `mypy/test/data/__init__.py`, or equivalently because you can't `import mypy.test.data.fixtures.list`, this wouldn't pull in `mypy/test/data/fixtures/list.py`, which is just as desired.\r\n\r\nI think in my ideal version of this interface, you could pass multiple `-m` arguments, multiple `-p` arguments, and multiple positional filename arguments, and they'd all just go on the queue together.\r\n\r\n(In principle I could simulate this by invoking `mypy` once for each file, but that's much slower because it repeats the work of typechecking dependencies.)\r\n"}}