Add a new output format option to print errors as GitHub Actions Workflow commands
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Feature
Add a new --output=github option to format errors as Workflow commands, similar to --output=json added in https://github.com/python/mypy/pull/11396.
Pitch
For example, for this output in JSON format
$ mypy src --output=json
{"file": "src/mylib/client.py", "line": 759, "column": 20, "message": "Argument 1 to \"export_responses\" of \"Client\" has incompatible type \"str\"; expected \"int\"", "hint": null, "code": "arg-type", "severity": "error"}
we'd get the following output in workflow command format
$ mypy src --output=json
::error file=src/mylib/client.py,line=759,col=20::(`arg-type`) Argument 1 to "export_responses" of "Client" has incompatible type "str"
Related:
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, die vorhandene --output=json-Option und ihre Befehlszeilenverarbeitung in mypy nachzuverfolgen, und vergleiche anschließend das angeforderte Beispiel für einen GitHub Actions Workflow-Befehl mit der aktuellen Fehlerausgabe. Die Aufgabe ist abgeschlossen, wenn mypy --output=github akzeptiert und das angeforderte ::error-Format einschließlich Datei, Zeile, Spalte, Code und Nachricht ausgibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- github-actions, python
- Bereich
- ci-cd, cli
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100