Manage ignore_missing_imports = true
sections configs automatically
#10044
Labels
ignore_missing_imports = true
sections configs automatically
#10044
Feature
When I'm adding typing to an existing project, I encounter many libraries that don't have type hints. The easy solution to suppressing these errors is setting
ignore_missing_imports = true
, but this is not great. The recommended solution, assuming you don't want to write your own stubs, is to create separate sections for each such library. This can be cumbersome to create and manage.I wrote myself a small tool that generates such configs: https://github.com/indigoviolet/mypy-missing-imports . I think it would be nice for mypy to include something like it, to make the "recommended" path easier to follow.
Pitch
I'm imagining something like
mypy --generate-missing-import-configs <optionally, /path/to/mypy.ini>
which would print out sections for each library identified as a
[import]
error likeIf passed a configuration file, it would update the corresponding sections in that file.
I'd be happy to try and add this to mypy if it is useful.
The text was updated successfully, but these errors were encountered: