python / python/mypy

Enable --pretty by default

Offen
#19,108 4 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature topic-usability
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Feature

Enable --pretty by default. --no-pretty can still be used to get more concise error messages (it already works, so no need to implement it).

--pretty causes mypy to show the line with the error, and mypy will highlight the location on the line where the error was reported:

foo.py:13: error: List item 0 has incompatible type "str"; expected "int"  [list-item]
    aa = ["x"]
          ^~~

Also update documentation, including relevant command-line examples which show the error output from mypy.

Pitch

The additional context makes it easier to see what is wrong. For example, there may be multiple possible expressions which can generate the error, and the highlighting makes this obvious.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Befehlszeilenverarbeitung für die vorhandene Option --pretty und die Dokumentationsbeispiele zu finden, die die Fehlerausgabe von mypy zeigen. Mache --pretty zum Standard, wobei das bestehende Verhalten von --no-pretty erhalten bleibt, aktualisiere anschließend die betroffenen Beispiele und überprüfe, dass ihre Ausgabe dem neuen Standard entspricht.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli, documentation
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.