Skip to content

Commit bfd4c09

Browse files
committed
Use different matcher for second regex
1 parent 7c61790 commit bfd4c09

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

sphinx_matcher.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
"line": 2,
1010
"severity": 3,
1111
"message": 4
12-
},
12+
}
13+
]
14+
},
15+
{
16+
"owner": "sphinx-problem-matcher-loose",
17+
"pattern": [
1318
{
1419
"_comment": "A bit of a looser pattern, doesn't look for line numbers, just looks for file names relying on them to start with / and end with .rst",
1520
"regexp": "(\/.*\\.rst):\\s+(\\w*):\\s+(.*)$",

test_matcher.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ var fs = require('fs');
44
const matcherJSON = fs.readFileSync('sphinx_matcher.json');
55
const matcher = JSON.parse(matcherJSON);
66

7-
const patterns = matcher.problemMatcher[0].pattern;
7+
let patterns = [];
8+
for (const problemMatcher of matcher.problemMatcher) {
9+
patterns.push(problemMatcher.pattern[0]);
10+
}
811

912
for (const pattern of patterns) {
1013
console.log("Patterns under test: ", pattern.regexp);

0 commit comments

Comments
 (0)