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

dump diagnostic info to json file #13017

Closed
2bndy5 opened this issue Jun 24, 2022 · 3 comments
Closed

dump diagnostic info to json file #13017

2bndy5 opened this issue Jun 24, 2022 · 3 comments
Labels

Comments

@2bndy5
Copy link

2bndy5 commented Jun 24, 2022

Feature

Add an optional generated report of all diagnostic information in json form. I'm thinking of something similar to the coverage report options, but tailored to any warnings/errors/notes produced by mypy (according to it's config).

Pitch

I'd like to write a problem matcher for my CI workflow(s). I could just use regex to parse stdout and go from there, but different projects have different output configurations. If I could get a comprehensive json (as verbose as possible) of all the errors/warnings/notes in json form, then I can adequately match the diagnostic info to exact places in the source code.

I imagine a single warning would look like:

[
  {
    "severity": "error",
    "line": 92,
    "column": 29,
    "path": "clang_autodoc/clang_parse.py",
    "symbol": "arg-type",
    "message": "Argument 1 to 'serialize_src_loc' of 'ClangParse' has incompatible type 'int'; expected 'SourceLocation'"
  }
]

FWIW, pylint has a similar CLI option:

pylint --output=json:somefile.json srcs/*.py
@2bndy5 2bndy5 added the feature label Jun 24, 2022
@AlexWaygood
Copy link
Member

Duplicate of #10816

@AlexWaygood AlexWaygood marked this as a duplicate of #10816 Jun 24, 2022
@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2022
@AlexWaygood
Copy link
Member

Duplicate of #10816

(note that this already has a PR attached to it :)

@2bndy5
Copy link
Author

2bndy5 commented Jun 24, 2022

Sorry it was hard to search through the 2K issues. Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants