stubtest: more concise error for forgotten arguments
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Feature
When the implementation adds new arguments (or the stubs forget some of the arguments), stubtest creates many errors if the new/forgotten argument isn't the last argument.
$ cat a.py
def fun(a, b, c, d, e): ...
$ cat a.pyi
def fun(b, c, d, e): ...
$ python -m mypy.stubtest a --concise
a.fun is inconsistent, stub argument "b" differs from runtime argument "a"
a.fun is inconsistent, stub argument "c" differs from runtime argument "b"
a.fun is inconsistent, stub argument "d" differs from runtime argument "c"
a.fun is inconsistent, stub argument "e" differs from runtime argument "d"
a.fun is inconsistent, stub does not have argument "e"
Pitch
$ python -m mypy.stubtest a --concise
a.fun is inconsistent, stub does not have argument "a"
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 damit, das Beispiel mit python -m mypy.stubtest a --concise zu reproduzieren, und untersuche den stubtest-Einstiegspunkt sowie dessen Meldungen zu Argumentabweichungen. Aktualisiere die kompakte Ausgabe so, dass ein fehlendes Argument einen Fehler statt einer Kaskade von Abweichungen erzeugt. Füge anschließend eine Abdeckung für den gezeigten Fall hinzu oder aktualisiere sie, und führe die relevanten stubtest-Tests aus.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- cli, testing
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100