-
Notifications
You must be signed in to change notification settings - Fork 154
/
object.js
34 lines (31 loc) · 858 Bytes
/
object.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const ESCAPE = '(?:\\x1b\\[\\d+m)'; // Matching to ANSI color escape sequence
const FILEPATH = '.+?';
const LINE = '\\d+';
const COL = '\\d+';
const MESSAGE = '.+?';
const KIND = '.+?';
let regexp = '^E?(F)E*:E*(L)E*:E*(C)E*: E*(M)E* \\[(K)\\]$';
regexp = regexp.replaceAll('E', ESCAPE);
regexp = regexp.replace('F', FILEPATH);
regexp = regexp.replace('L', LINE);
regexp = regexp.replace('C', COL);
regexp = regexp.replace('M', MESSAGE);
regexp = regexp.replace('K', KIND);
const object = {
problemMatcher: [
{
owner: 'actionlint',
pattern: [
{
regexp,
file: 1,
line: 2,
column: 3,
message: 4,
code: 5,
},
],
},
],
};
module.exports = object;