forked from reviewdog/reviewdog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Diagnostic.jsonschema
135 lines (135 loc) · 7.58 KB
/
Diagnostic.jsonschema
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"message": {
"type": "string",
"description": "The diagnostic's message."
},
"location": {
"properties": {
"path": {
"type": "string",
"description": "File path. It could be either absolute path or relative path."
},
"range": {
"$ref": "reviewdog.rdf.Range",
"additionalProperties": true,
"type": "object",
"description": "Range in the file path.\n Optional."
}
},
"additionalProperties": true,
"type": "object",
"description": "Location at which this diagnostic message applies."
},
"severity": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
}
],
"description": "This diagnostic's severity.\n Optional."
},
"source": {
"properties": {
"name": {
"type": "string",
"description": "A human-readable string describing the source of diagnostics, e.g.\n 'typescript' or 'super lint'."
},
"url": {
"type": "string",
"description": "URL to this source.\n Optional."
}
},
"additionalProperties": true,
"type": "object",
"description": "The source of this diagnostic, e.g. 'typescript' or 'super lint'.\n Optional."
},
"code": {
"properties": {
"value": {
"type": "string",
"description": "This rule's code/identifier."
},
"url": {
"type": "string",
"description": "A URL to open with more information about this rule code.\n Optional."
}
},
"additionalProperties": true,
"type": "object",
"description": "This diagnostic's rule code.\n Optional."
},
"suggestions": {
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"range": {
"$ref": "reviewdog.rdf.Range",
"additionalProperties": true,
"type": "object",
"description": "Range at which this suggestion applies.\n To insert text into a document create a range where start == end."
},
"text": {
"type": "string",
"description": "A suggested text which replace the range.\n For delete operations use an empty string."
}
},
"additionalProperties": true,
"type": "object",
"description": "Suggestion represents a suggested text manipulation to resolve a diagnostic\n problem.\n\n Insert example ('hayabusa' -\u003e 'haya15busa'):\n range {\n start {\n line: 1\n column: 5\n }\n end {\n line: 1\n column: 5\n }\n }\n text: 15\n |h|a|y|a|b|u|s|a|\n 1 2 3 4 5 6 7 8 9\n ^--- insert '15'\n\n Update example ('haya15busa' -\u003e 'haya14busa'):\n range {\n start {\n line: 1\n column: 5\n }\n end {\n line: 1\n column: 7\n }\n }\n text: 14\n |h|a|y|a|1|5|b|u|s|a|\n 1 2 3 4 5 6 7 8 9 0 1\n ^---^ replace with '14'"
},
"type": "array",
"description": "Suggested fixes to resolve this diagnostic.\n Optional."
},
"original_output": {
"type": "string",
"description": "Experimental: If this diagnostic is converted from other formats,\n original_output represents the original output which corresponds to this\n diagnostic.\n Optional."
}
},
"additionalProperties": true,
"type": "object",
"description": "Represents a diagnostic, such as a compiler error or warning.\n It's intended to be used as structured format which represents a\n diagnostic and can be used as stream of input/output such as jsonl.\n This message should be self-contained to report a diagnostic.",
"definitions": {
"reviewdog.rdf.Position": {
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"line": {
"type": "integer",
"description": "Line number, starting at 1.\n Optional."
},
"column": {
"type": "integer",
"description": "Column number, starting at 1 (byte count in UTF-8).\n Example: 'a𐐀b'\n The column of a: 1\n The column of 𐐀: 2\n The column of b: 6 since 𐐀 is represented with 4 bytes in UTF-8.\n Optional."
}
},
"additionalProperties": true,
"type": "object",
"id": "reviewdog.rdf.Position"
},
"reviewdog.rdf.Range": {
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"start": {
"$ref": "reviewdog.rdf.Position",
"additionalProperties": true,
"type": "object",
"description": "Required."
},
"end": {
"$ref": "reviewdog.rdf.Position",
"additionalProperties": true,
"type": "object",
"description": "end can be omitted. Then the range is handled as zero-length (start == end).\n Optional."
}
},
"additionalProperties": true,
"type": "object",
"description": "A range in a text document expressed as start and end positions.\n\nThe end position is *exclusive*. It might be a bit unnatural for you or for\n some diagnostic tools to use exclusive range, but it's necessary to represent\n zero-width range especially when using it in Suggestion context to support\n code insertion.\n Example: \"14\" in \"haya14busa\"\n start: { line: 1, column: 5 }\n end: { line: 1, column: 7 } # \u003c= Exclusive\n\n |h|a|y|a|1|4|b|u|s|a|\n 1 2 3 4 5 6 7 8 9 0 1\n ^---^\n haya14busa\n ^^\n\n If you want to specify a range that\n contains a line including the line ending character(s), then use an end\n position denoting the start of the next line.\n Example:\n start: { line: 5, column: 23 }\n end: { line: 6, column: 1 }\n\n If both start and end position omit column value, it's\n handled as linewise and the range includes end position (line) as well.\n Example:\n start: { line: 5 }\n end: { line: 6 }\n The above example represents range start from line 5 to the end of line 6\n including EOL.\n\n Examples for line range:\n Text example. \u003cline\u003e|\u003cline content\u003e(line breaking)\n 1|abc\\r\\n\n 2|def\\r\\n\n 3|ghi\\r\\n\n\n start: { line: 2 }\n =\u003e \"abc\"\n\n start: { line: 2 }\n end: { line: 2 }\n =\u003e \"abc\"\n\n start: { line: 2 }\n end: { line: 3 }\n =\u003e \"abc\\r\\ndef\"\n\n start: { line: 2 }\n end: { line: 3, column: 1 }\n =\u003e \"abc\\r\\n\"\n\nstart: { line: 2, column: 1 }\n end: { line: 2, column: 4 }\n =\u003e \"abc\" (without line-break)",
"id": "reviewdog.rdf.Range"
}
}
}