diff --git a/Integration.md b/Integration.md index 35fcd1b..1e1b13a 100644 --- a/Integration.md +++ b/Integration.md @@ -20,41 +20,73 @@ ShellCheck currently has three machine parseable output formats ### JSON output -ShellCheck can output a simple JSON format consisting of a single array of objects (formatted for clarity): +ShellCheck can output a simple JSON format consisting of an object with a list of comments (formatted for clarity): ``` $ shellcheck -f json1 myscript myotherscript -[ - { - "file": "myotherscript", - "line": 2, - "column": 2, - "level": "error", - "code": 1035, - "message": "You need a space after the [ and before the ]." - }, - { - "file": "myscript", - "line": 2, - "column": 6, - "level": "warning", - "code": 2039, - "message": "In POSIX sh, echo flags are undefined." - }, - { - "file": "myscript", - "line": 2, - "column": 9, - "level": "info", - "code": 2086, - "message": "Double quote to prevent globbing and word splitting." - } -] +{ + "comments": [ + { + "file": "myotherscript", + "line": 2, + "endLine": 2, + "column": 1, + "endColumn": 2, + "level": "error", + "code": 1035, + "message": "You need a space after the [ and before the ].", + "fix": null + }, + { + "file": "myscript", + "line": 2, + "endLine": 2, + "column": 6, + "endColumn": 8, + "level": "warning", + "code": 2039, + "message": "In POSIX sh, echo flags are undefined.", + "fix": null + }, + { + "file": "myscript", + "line": 2, + "endLine": 2, + "column": 9, + "endColumn": 11, + "level": "info", + "code": 2086, + "message": "Double quote to prevent globbing and word splitting.", + "fix": { + "replacements": [ + { + "line": 2, + "endLine": 2, + "precedence": 7, + "insertionPoint": "afterEnd", + "column": 9, + "replacement": "\"", + "endColumn": 9 + }, + { + "line": 2, + "endLine": 2, + "precedence": 7, + "insertionPoint": "beforeStart", + "column": 11, + "replacement": "\"", + "endColumn": 11 + } + ] + } + } + ] +} ``` In the `json1` format, `line` and `column` start at 1, and tabs count as 1. -The legacy format `json` is the same, but with a tab stop of 8. +The legacy format `json` consists of just the `comments` array, with a tab stop of 8. ### XML output