Skip to content

Commit 1375b77

Browse files
committed
fix match deserialzation and add test
1 parent 03063c9 commit 1375b77

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
config_version = "0"
22

3-
[plugins.definitions.exists]
3+
[plugins.definitions.triaged]
44
file_types = ["shell"]
55

6-
[plugins.definitions.exists.drivers.lint]
6+
[plugins.definitions.triaged.drivers.lint]
77
script = "false"
88
success_codes = [0]
99
output = "pass_fail"
1010
batch = true
1111

1212
[[plugin]]
13-
name = "exists"
13+
name = "triaged"
14+
version = "1.0.0"
15+
16+
[plugins.definitions.untriaged]
17+
file_types = ["shell"]
18+
19+
[plugins.definitions.untriaged.drivers.lint]
20+
script = "false"
21+
success_codes = [0]
22+
output = "pass_fail"
23+
batch = true
24+
25+
[[plugin]]
26+
name = "untriaged"
1427
version = "1.0.0"
1528

1629
[[triage]]
17-
match.plugins = ["exists"]
18-
match.rules = ["fail"]
30+
match.plugins = ["triaged"]
1931
set.mode = "comment"
2032
set.level = "low"
2133
set.category = "structure"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1 issue
1+
2 issues

qlty-cli/tests/cmd/check/triage.stdout

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
[
22
{
3-
"tool": "exists",
3+
"tool": "untriaged",
44
"ruleKey": "fail",
5-
"message": "exists failed",
5+
"message": "untriaged failed",
6+
"level": "LEVEL_HIGH",
7+
"category": "CATEGORY_LINT",
8+
"mode": "MODE_BLOCK"
9+
},
10+
{
11+
"tool": "triaged",
12+
"ruleKey": "fail",
13+
"message": "triaged failed",
614
"level": "LEVEL_LOW",
715
"category": "CATEGORY_STRUCTURE",
816
"mode": "MODE_COMMENT"

qlty-config/src/config/triage.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub struct Set {
5252
#[derive(Debug, Serialize, Deserialize, Default, Clone, JsonSchema)]
5353
pub struct Triage {
5454
#[serde(default)]
55+
#[serde(rename = "match")]
5556
pub _match: Match,
5657

5758
#[serde(default)]

0 commit comments

Comments
 (0)