-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 xpath support for Problem Matcher #260
Comments
i'll defer to others, but in general we've aligned with vscode problem matchers |
@chrispat fyi |
Is there a way to help moving this forward? I really want to see this happening 😉 |
Problem matchers plugin to how the runner processes streaming output. I'm not sure this fits into that plugin model. It sounds like you want to process the json file, and create error/warning annotations. It is possible, but it looks like |
related to #186 |
Problem matchers are for parsing console output and are run line by line. In you case you want a file and the runner won't when to process the file. One option would be to write an action to process the file and create annotations. |
@chrispat I'm working on an action that runs eslint with I'm also wondering if another option would be to add a problem matcher for the JSON itself? e.g. Create kind of a custom format with the JSON and just calling |
You can pretty easily create your own annotations by issuing commands like https://help.github.com/en/actions/reference/development-tools-for-github-actions#set-a-warning-message-warning. The toolkit function https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L19 makes it easy to format the parameters for the command. The problem matcher is really designed to mostly work against text log output at a single line level. While I am sure it would be possible to build something that would recognize JSON in an output stream I am not sure it is practical or a good use of time right now. |
Describe the enhancement
Sniffing through logs using RegExp can be hairy especially if your need multiline line matching. In my particular use case I want to write a Problem Matcher for jest. The output from
jest
is very human friendly.Jest provides a CLI argument to print the test results in JSON. However, parsing this output using RegExp isn't that simple either.
What if the Problem Matcher API would allow us to use xpath to grep values from a json file on disc. Such an API would be useful and quite powerful addition.
Code Snippet
The text was updated successfully, but these errors were encountered: