Skip to content

Commit 08c704d

Browse files
committed
fix: JSON schema about severities
1 parent e12d070 commit 08c704d

File tree

2 files changed

+58
-148
lines changed

2 files changed

+58
-148
lines changed

jsonschema/golangci.jsonschema.json

+29-74
Original file line numberDiff line numberDiff line change
@@ -332,57 +332,6 @@
332332
"type": "string"
333333
}
334334
]
335-
},
336-
"issue-match-path": {
337-
"type": "object",
338-
"properties": {
339-
"path": {
340-
"type": "string"
341-
},
342-
"severity": {
343-
"$comment": "This is here only to allow `additionalProperties: false`."
344-
}
345-
},
346-
"additionalProperties": false
347-
},
348-
"issue-match-linters": {
349-
"type": "object",
350-
"properties": {
351-
"linters": {
352-
"type": "array",
353-
"items": {
354-
"$ref": "#/definitions/linters"
355-
}
356-
},
357-
"severity": {
358-
"$comment": "This is here only to allow `additionalProperties: false`."
359-
}
360-
},
361-
"additionalProperties": false
362-
},
363-
"issue-match-source": {
364-
"type": "object",
365-
"properties": {
366-
"source": {
367-
"type": "string"
368-
},
369-
"severity": {
370-
"$comment": "This is here only to allow `additionalProperties: false`."
371-
}
372-
},
373-
"additionalProperties": false
374-
},
375-
"issue-match-text": {
376-
"type": "object",
377-
"properties": {
378-
"text": {
379-
"type": "string"
380-
},
381-
"severity": {
382-
"$comment": "This is here only to allow `additionalProperties: false`."
383-
}
384-
},
385-
"additionalProperties": false
386335
}
387336
},
388337
"type": "object",
@@ -3461,32 +3410,38 @@
34613410
"description": "When a list of severity rules are provided, severity information will be added to lint issues. Severity rules have the same filtering capability as exclude rules except you are allowed to specify one matcher per severity rule.\nOnly affects out formats that support setting severity information.",
34623411
"type": "array",
34633412
"items": {
3464-
"allOf": [
3465-
{
3466-
"oneOf": [
3467-
{
3468-
"$ref": "#/definitions/issue-match-path"
3469-
},
3470-
{
3471-
"$ref": "#/definitions/issue-match-source"
3472-
},
3473-
{
3474-
"$ref": "#/definitions/issue-match-linters"
3475-
},
3476-
{
3477-
"$ref": "#/definitions/issue-match-text"
3478-
}
3479-
]
3413+
"type": "object",
3414+
"additionalProperties": false,
3415+
"properties": {
3416+
"severity": {
3417+
"type": "string"
34803418
},
3481-
{
3482-
"properties": {
3483-
"severity": {
3484-
"type": "string"
3485-
}
3419+
"path": {
3420+
"type": "string"
3421+
},
3422+
"path-except": {
3423+
"type": "string"
3424+
},
3425+
"linters": {
3426+
"type": "array",
3427+
"items": {
3428+
"$ref": "#/definitions/linters"
34863429
}
3430+
},
3431+
"text": {
3432+
"type": "string"
3433+
},
3434+
"source": {
3435+
"type": "string"
34873436
}
3488-
],
3489-
"required": ["severity"]
3437+
},
3438+
"anyOf": [
3439+
{ "required": ["severity", "path"] },
3440+
{ "required": ["severity", "path-except"] },
3441+
{ "required": ["severity", "linters"] },
3442+
{ "required": ["severity", "text"] },
3443+
{ "required": ["severity", "source"] }
3444+
]
34903445
},
34913446
"default": []
34923447
}

jsonschema/golangci.next.jsonschema.json

+29-74
Original file line numberDiff line numberDiff line change
@@ -333,57 +333,6 @@
333333
"type": "string"
334334
}
335335
]
336-
},
337-
"issue-match-path": {
338-
"type": "object",
339-
"properties": {
340-
"path": {
341-
"type": "string"
342-
},
343-
"severity": {
344-
"$comment": "This is here only to allow `additionalProperties: false`."
345-
}
346-
},
347-
"additionalProperties": false
348-
},
349-
"issue-match-linters": {
350-
"type": "object",
351-
"properties": {
352-
"linters": {
353-
"type": "array",
354-
"items": {
355-
"$ref": "#/definitions/linters"
356-
}
357-
},
358-
"severity": {
359-
"$comment": "This is here only to allow `additionalProperties: false`."
360-
}
361-
},
362-
"additionalProperties": false
363-
},
364-
"issue-match-source": {
365-
"type": "object",
366-
"properties": {
367-
"source": {
368-
"type": "string"
369-
},
370-
"severity": {
371-
"$comment": "This is here only to allow `additionalProperties: false`."
372-
}
373-
},
374-
"additionalProperties": false
375-
},
376-
"issue-match-text": {
377-
"type": "object",
378-
"properties": {
379-
"text": {
380-
"type": "string"
381-
},
382-
"severity": {
383-
"$comment": "This is here only to allow `additionalProperties: false`."
384-
}
385-
},
386-
"additionalProperties": false
387336
}
388337
},
389338
"type": "object",
@@ -3476,32 +3425,38 @@
34763425
"description": "When a list of severity rules are provided, severity information will be added to lint issues. Severity rules have the same filtering capability as exclude rules except you are allowed to specify one matcher per severity rule.\nOnly affects out formats that support setting severity information.",
34773426
"type": "array",
34783427
"items": {
3479-
"allOf": [
3480-
{
3481-
"oneOf": [
3482-
{
3483-
"$ref": "#/definitions/issue-match-path"
3484-
},
3485-
{
3486-
"$ref": "#/definitions/issue-match-source"
3487-
},
3488-
{
3489-
"$ref": "#/definitions/issue-match-linters"
3490-
},
3491-
{
3492-
"$ref": "#/definitions/issue-match-text"
3493-
}
3494-
]
3428+
"type": "object",
3429+
"additionalProperties": false,
3430+
"properties": {
3431+
"severity": {
3432+
"type": "string"
34953433
},
3496-
{
3497-
"properties": {
3498-
"severity": {
3499-
"type": "string"
3500-
}
3434+
"path": {
3435+
"type": "string"
3436+
},
3437+
"path-except": {
3438+
"type": "string"
3439+
},
3440+
"linters": {
3441+
"type": "array",
3442+
"items": {
3443+
"$ref": "#/definitions/linters"
35013444
}
3445+
},
3446+
"text": {
3447+
"type": "string"
3448+
},
3449+
"source": {
3450+
"type": "string"
35023451
}
3503-
],
3504-
"required": ["severity"]
3452+
},
3453+
"anyOf": [
3454+
{ "required": ["severity", "path"] },
3455+
{ "required": ["severity", "path-except"] },
3456+
{ "required": ["severity", "linters"] },
3457+
{ "required": ["severity", "text"] },
3458+
{ "required": ["severity", "source"] }
3459+
]
35053460
},
35063461
"default": []
35073462
}

0 commit comments

Comments
 (0)