diff --git a/Integration.md b/Integration.md index 1e1b13a..881dd2e 100644 --- a/Integration.md +++ b/Integration.md @@ -7,7 +7,7 @@ The easiest way is to just invoke `shellcheck`, either on a file or on stdin, an Here is an integration checklist. Each point is described further below: -1. Pick a machine parsable output format: json, xml or gcc +1. Pick a machine parsable output format: json, xml, gcc or diff 1. Decide whether you want to manually specify a shell dialect 1. Decide whether you want to follow `source`d files that are not specified as input 1. Check `shellcheck`s exit code @@ -123,6 +123,19 @@ myotherscript:2:2: error: You need a space after the [ and before the ]. [SC1035 `line` and `column` start at 1, and assume a tab size of 1 (like `gcc` itself). +### Unified Diff + +While ShellCheck's fix suggestions can be found in the `json1` format, it's not well documented or easy to deal with. With `-f diff`, you can instead get standard unified diff output: + +``` +$ shellcheck -f diff file +--- a/file ++++ b/file +@@ -1,2 +1,2 @@ + #!/bin/sh +-echo $1 ++echo "$1" +``` ## Decide whether you want to specify a shell dialect