summaryrefslogtreecommitdiff
path: root/doc/ale-go.txt
blob: baf403b73c96232aeadbb08b0766e6992a208454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
===============================================================================
ALE Go Integration                                             *ale-go-options*


===============================================================================
Integration Information

The `gometalinter` linter is disabled by default. ALE enables `gofmt`,
`golint` and `go vet` by default. It also supports `staticcheck`, `go
build` and `gosimple`.

To enable `gometalinter`, update |g:ale_linters| as appropriate:
>
  " Enable all of the linters you want for Go.
  let g:ale_linters = {'go': ['gometalinter', 'gofmt']}
<
A possible configuration is to enable `gometalinter` and `gofmt` but paired
with the `--fast` option, set by |g:ale_go_gometalinter_options|. This gets you
the benefit of running a number of linters, more than ALE would by default,
while ensuring it doesn't run any linters known to be slow or resource
intensive.


===============================================================================
gobuild                                                        *ale-go-gobuild*

g:ale_go_gobuild_options                             *g:ale_go_gobuild_options*
                                                     *b:ale_go_gobuild_options*
  Type: |String|
  Default: `''`

  This variable can be set to pass additional options to the gobuild linter.
  They are injected directly after "go test".


===============================================================================
gofmt                                                            *ale-go-gofmt*

g:ale_go_gofmt_options                                 *g:ale_go_gofmt_options*
                                                       *b:ale_go_gofmt_options*
  Type: |String|
  Default: `''`

  This variable can be set to pass additional options to the gofmt fixer.


===============================================================================
govet                                                            *ale-go-govet*

g:ale_go_govet_options                                 *g:ale_go_govet_options*
                                                       *b:ale_go_govet_options*
  Type: |String|
  Default: `''`

  This variable can be set to pass additional options to the go vet linter.


===============================================================================
gometalinter                                              *ale-go-gometalinter*

`gometalinter` is a `lint_file` linter, which only lints files that are
written to disk. This differs from the default behavior of linting the buffer.
See: |ale-lint-file|

g:ale_go_gometalinter_executable             *g:ale_go_gometalinter_executable*
                                             *b:ale_go_gometalinter_executable*
  Type: |String|
  Default: `'gometalinter'`

  The executable that will be run for gometalinter.


g:ale_go_gometalinter_options                   *g:ale_go_gometalinter_options*
                                                *b:ale_go_gometalinter_options*
  Type: |String|
  Default: `''`

  This variable can be changed to alter the command-line arguments to the
  gometalinter invocation.

  Since `gometalinter` runs a number of linters that can consume a lot of
  resources it's recommended to set this option to a value of `--fast` if you
  use `gometalinter` as one of the linters in |g:ale_linters|. This disables a
  number of linters known to be slow or consume a lot of resources.


g:ale_go_gometalinter_lint_package         *g:ale_go_gometalinter_lint_package*
                                           *b:ale_go_gometalinter_lint_package*
  Type: |Number|
  Default: `0`

  When set to `1`, the whole Go package will be checked instead of only the
  current file.


===============================================================================
staticcheck                                                *ale-go-staticcheck*

g:ale_go_staticcheck_options                     *g:ale_go_staticcheck_options*
                                                 *b:ale_go_staticcheck_options*
  Type: |String|
  Default: `''`

  This variable can be set to pass additional options to the staticcheck
  linter.


g:ale_go_staticcheck_lint_package           *g:ale_go_staticcheck_lint_package*
                                            *b:ale_go_staticcheck_lint_package*
  Type: |Number|
  Default: `0`

  When set to `1`, the whole Go package will be checked instead of only the
  current file.


===============================================================================
  vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: