Add --exclude (#9992)
Resolves #4675, resolves #9981.
Additionally, we always ignore site-packages and node_modules,
and directories starting with a dot. Also note that this doesn't really
affect import discovery; it only directly affects passing files or
packages to mypy.
The additional check before suggesting "are you missing an
__init__.py" didn't make any sense to me, so I removed it, appended to
the message and downgraded the severity to note.
Co-authored-by: hauntsaninja <>