Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
edgarrmondragon opened this issue Jul 31, 2024 · 4 comments · May be fixed by #17771
Open

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

edgarrmondragon opened this issue Jul 31, 2024 · 4 comments · May be fixed by #17771
Labels

Comments

@edgarrmondragon
Copy link

edgarrmondragon commented Jul 31, 2024

Feature

Add a new --output=github option to format errors as Workflow commands, similar to --output=json added in #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:

@wyardley
Copy link

This would be super handy

@webknjaz
Copy link

@edgarrmondragon do you mean using the annotations feature?

@wyardley
Copy link

I'm not the person who opened the issue, but yes, I think this would support allowing annotations, similar to
ruff check --output-format github or using pylint with the pylint-actions plugin.

@edgarrmondragon
Copy link
Author

@edgarrmondragon do you mean using the annotations feature?

Yeah, these: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions

I'm not the person who opened the issue, but yes, I think this would support allowing annotations, similar to
ruff check --output-format github or using pylint with the pylint-actions plugin.

Exactly!

@edgarrmondragon edgarrmondragon linked a pull request Sep 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants