python / python/mypy

Add a new output format option to print errors as GitHub Actions Workflow commands

Open
#17,612 7 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing --output=json option and its command-line handling in mypy, then compare the requested GitHub Actions Workflow command example with current error output. Done means mypy accepts --output=github and emits the requested ::error format, including file, line, column, code, and message.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.