github.com/mistwind/reviewdog@v0.0.0-20230322024206-9cfa11856d58/proto/rdf/jsonschema/Diagnostic.jsonschema (about)

     1  {
     2      "$schema": "http://json-schema.org/draft-04/schema#",
     3      "properties": {
     4          "message": {
     5              "type": "string",
     6              "description": "The diagnostic's message."
     7          },
     8          "location": {
     9              "properties": {
    10                  "path": {
    11                      "type": "string",
    12                      "description": "File path. It could be either absolute path or relative path."
    13                  },
    14                  "range": {
    15                      "$ref": "reviewdog.rdf.Range",
    16                      "additionalProperties": true,
    17                      "type": "object",
    18                      "description": "Range in the file path.\n Optional."
    19                  }
    20              },
    21              "additionalProperties": true,
    22              "type": "object",
    23              "description": "Location at which this diagnostic message applies."
    24          },
    25          "severity": {
    26              "oneOf": [
    27                  {
    28                      "type": "string"
    29                  },
    30                  {
    31                      "type": "integer"
    32                  }
    33              ],
    34              "description": "This diagnostic's severity.\n Optional."
    35          },
    36          "source": {
    37              "properties": {
    38                  "name": {
    39                      "type": "string",
    40                      "description": "A human-readable string describing the source of diagnostics, e.g.\n 'typescript' or 'super lint'."
    41                  },
    42                  "url": {
    43                      "type": "string",
    44                      "description": "URL to this source.\n Optional."
    45                  }
    46              },
    47              "additionalProperties": true,
    48              "type": "object",
    49              "description": "The source of this diagnostic, e.g. 'typescript' or 'super lint'.\n Optional."
    50          },
    51          "code": {
    52              "properties": {
    53                  "value": {
    54                      "type": "string",
    55                      "description": "This rule's code/identifier."
    56                  },
    57                  "url": {
    58                      "type": "string",
    59                      "description": "A URL to open with more information about this rule code.\n Optional."
    60                  }
    61              },
    62              "additionalProperties": true,
    63              "type": "object",
    64              "description": "This diagnostic's rule code.\n Optional."
    65          },
    66          "suggestions": {
    67              "items": {
    68                  "$schema": "http://json-schema.org/draft-04/schema#",
    69                  "properties": {
    70                      "range": {
    71                          "$ref": "reviewdog.rdf.Range",
    72                          "additionalProperties": true,
    73                          "type": "object",
    74                          "description": "Range at which this suggestion applies.\n To insert text into a document create a range where start == end."
    75                      },
    76                      "text": {
    77                          "type": "string",
    78                          "description": "A suggested text which replace the range.\n For delete operations use an empty string."
    79                      }
    80                  },
    81                  "additionalProperties": true,
    82                  "type": "object",
    83                  "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'"
    84              },
    85              "type": "array",
    86              "description": "Suggested fixes to resolve this diagnostic.\n Optional."
    87          },
    88          "original_output": {
    89              "type": "string",
    90              "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."
    91          }
    92      },
    93      "additionalProperties": true,
    94      "type": "object",
    95      "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.",
    96      "definitions": {
    97          "reviewdog.rdf.Position": {
    98              "$schema": "http://json-schema.org/draft-04/schema#",
    99              "properties": {
   100                  "line": {
   101                      "type": "integer",
   102                      "description": "Line number, starting at 1.\n Optional."
   103                  },
   104                  "column": {
   105                      "type": "integer",
   106                      "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."
   107                  }
   108              },
   109              "additionalProperties": true,
   110              "type": "object",
   111              "id": "reviewdog.rdf.Position"
   112          },
   113          "reviewdog.rdf.Range": {
   114              "$schema": "http://json-schema.org/draft-04/schema#",
   115              "properties": {
   116                  "start": {
   117                      "$ref": "reviewdog.rdf.Position",
   118                      "additionalProperties": true,
   119                      "type": "object",
   120                      "description": "Required."
   121                  },
   122                  "end": {
   123                      "$ref": "reviewdog.rdf.Position",
   124                      "additionalProperties": true,
   125                      "type": "object",
   126                      "description": "end can be omitted. Then the range is handled as zero-length (start == end).\n Optional."
   127                  }
   128              },
   129              "additionalProperties": true,
   130              "type": "object",
   131              "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)",
   132              "id": "reviewdog.rdf.Range"
   133          }
   134      }
   135  }