2 "Title": "Output formatters"
5 <h2 id="text">Text</h2>
8 <em>Text</em> is the default output formatter.
9 It formats problems using the following format: <code>file:line:col: message</code>.
10 This format is commonly used by compilers and linters,
11 and is understood by most editors.
14 <h3>Example output</h3>
15 <pre><code>go/src/fmt/print.go:1069:15: this value of afterIndex is never used (SA4006)</code></pre>
17 <h2 id="stylish">Stylish</h2>
20 <em>Stylish</em> is a formatter designed for human consumption.
21 It groups results by file name
22 and breaks up the various pieces of information into columns.
23 Additionally, it displays a final summary.
27 This output format is not suited for automatic consumption by tools
28 and may change between versions.
31 <pre><code>go/src/fmt/fmt_test.go
32 (43, 2) S1021 should merge variable declaration with assignment on next line
33 (1185, 10) SA9003 empty branch
36 (77, 18) ST1006 methods on the same type should have the same receiver name (seen 3x "b", 1x "bp")
37 (1069, 15) SA4006 this value of afterIndex is never used
40 (465, 5) ST1012 error var complexError should have name of the form errFoo
41 (466, 5) ST1012 error var boolError should have name of the form errFoo
43 ✖ 6 problems (6 errors, 0 warnings)
46 <h2 id="json">JSON</h2>
49 The JSON formatter emits one JSON object per problem found –
50 that is, it is a stream of objects, not an array.
51 Most fields should be self-explanatory.
55 The <code>severity</code> field may be one of
56 <code>"error"</code>, <code>"warning"</code> or <code>"ignored"</code>.
57 Whether a problem is an error or a warning is determined by the <code>-fail</code> flag.
58 The value <code>"ignored"</code> is used for problems that were ignored,
59 if the <code>-show-ignored</code> flag was provided.
62 <h3>Example output</h3>
64 Note that actual output is not formatted nicely.
65 The example has been formatted to improve readability.
72 "file": "/usr/lib/go/src/fmt/print.go",
77 "file": "/usr/lib/go/src/fmt/print.go",
81 "message": "this value of afterIndex is never used"