JSON problem matchers should support `"loop": true` in patterns other than the last one
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the enhancement
According to https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md#single-line-matchers:
loop: whether to loop until a match is not found, only valid on the last pattern of a multipattern matcher
However, I would like to be able to loop in the middle of a pattern, and then, once there are no more matches for that pattern, accumulate a couple more lines.
Code Snippet
In particular, the pattern I want to use is:
{
"problemMatcher": [
{
"owner": "coq-problem-matcher-multiline",
"pattern": [
{
"regexp": "^File \"([^ \"]+)\", line (\\d+), characters (\\d+-\\d+):",
"file": 1,
"line": 2,
"column": 3
},
{
"regexp": "^(Warning|Error):\\s*((?:[^\\]]|\\].)*)$",
"severity": 1,
"message": 2
},
{
"regexp": "^((?:[^\\]]|\\].)*)$",
"severity": 1,
"message": 2,
"loop": true
},
{
"regexp": "^(.*?)\\s*\\[(.*)\\]$",
"message": 1,
"code": 2
}
]
}
]
}
That is, an error message starts with a line File "<FILE>", line <LINE>, characters <COLUMN>:, followed by a line starting with either Warning: or Error:, followed by a potentially multiline message which is recognized as ending with [<CODE>] followed by a newline. (The matcher I wrote isn't perfect, and I end up needing four separate matchers: one for one-line messages, one for two-line messages (unless "loop": true allows zero-or-more rather than one-or-more?), and one for three-or-more-line messages.)
Additional information
Trying this out in https://github.com/mit-plv/fiat-crypto/pull/910
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the linked problem-matchers documentation and the Coq JSON example first, then locate the toolkit's problem-matcher parsing and matching entry point. Confirm the intended behavior for a loop in a non-final pattern, including whether zero matches are allowed, and define completion with coverage for the stated multiline matcher cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ci-cd, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100