From 6591dafce0b3b76a907c2512c108093580190fce Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 4 Sep 2020 14:30:14 -0700 Subject: [PATCH] Documented the JSON output when "--outputjson" command-line option is used. --- docs/command-line.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/command-line.md b/docs/command-line.md index 0f79379d2..1947f883f 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -39,3 +39,26 @@ Pyright can be run as either a VS Code extension or as a node-based command-line | 2 | Fatal error occurred with no errors or warnings reported | | 3 | Config file could not be read or parsed | + +# JSON Output + +If the “--outputjson” option is specified on the command line, diagnostics are output in JSON format. The JSON structure is as follows: +```javascript +{ + file: string, + severity: 'error' | 'warning', + message: string, + range: { + start: { + line: number, + character: number + }, + end: { + line: number, + character: number + } + } +} + +Line and character numbers are zero-based. +```