Manage `ignore_missing_imports = true` sections configs automatically
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
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 like
[mypy-foo.*]
ignore_missing_imports = true
If 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit mypy's Befehlszeilenverarbeitung und Konfigurationsverarbeitung, wobei der vorgeschlagene Befehl mypy --generate-missing-import-configs und die optionale Eingabe mypy.ini als Einstiegspunkte dienen. Überprüfe das referenzierte Tool mypy-missing-imports hinsichtlich des vorgesehenen Verhaltens. Als abgeschlossen gilt die Aufgabe, wenn Abschnitte pro Bibliothek wie [mypy-foo.*] mit ignore_missing_imports = true generiert oder aktualisiert werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100