2017-04-13 05:27:09 -04:00
|
|
|
===============================================================================
|
2017-07-06 19:10:30 -04:00
|
|
|
ALE Go Integration *ale-go-options*
|
2017-04-13 05:27:09 -04:00
|
|
|
|
|
|
|
|
2017-07-08 09:17:26 -04:00
|
|
|
===============================================================================
|
2017-04-15 16:04:43 -04:00
|
|
|
Integration Information
|
|
|
|
|
2017-05-30 08:39:22 -04:00
|
|
|
The `gometalinter` linter is disabled by default. ALE enables `gofmt`,
|
|
|
|
`golint` and `go vet` by default. It also supports `staticcheck`, `go
|
2018-08-29 22:39:03 -04:00
|
|
|
build`, `gosimple`, and `golangserver`.
|
2017-05-30 08:39:22 -04:00
|
|
|
|
|
|
|
To enable `gometalinter`, update |g:ale_linters| as appropriate:
|
2017-04-15 16:04:43 -04:00
|
|
|
>
|
|
|
|
" Enable all of the linters you want for Go.
|
|
|
|
let g:ale_linters = {'go': ['gometalinter', 'gofmt']}
|
|
|
|
<
|
2017-05-30 08:39:22 -04:00
|
|
|
A possible configuration is to enable `gometalinter` and `gofmt` but paired
|
2017-07-20 20:36:40 -04:00
|
|
|
with the `--fast` option, set by |g:ale_go_gometalinter_options|. This gets you
|
2017-05-30 08:39:22 -04:00
|
|
|
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.
|
2017-04-15 16:04:43 -04:00
|
|
|
|
2018-09-19 14:33:23 -04:00
|
|
|
g:ale_go_go_executable *g:ale_go_go_options*
|
|
|
|
*b:ale_go_go_options*
|
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `'go'`
|
|
|
|
|
|
|
|
The executable that will be run for the `gobuild` and `govet` linters, and
|
|
|
|
the gomod` fixer.
|
|
|
|
|
2018-02-15 06:23:36 -05:00
|
|
|
|
2018-02-04 08:55:09 -05:00
|
|
|
===============================================================================
|
|
|
|
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".
|
|
|
|
|
|
|
|
|
2017-10-03 13:54:35 -04:00
|
|
|
===============================================================================
|
|
|
|
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.
|
|
|
|
|
2018-02-15 06:23:36 -05:00
|
|
|
|
2018-08-15 22:02:51 -04:00
|
|
|
===============================================================================
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
2017-07-08 09:17:26 -04:00
|
|
|
===============================================================================
|
2017-07-06 19:10:30 -04:00
|
|
|
gometalinter *ale-go-gometalinter*
|
2017-04-13 05:27:09 -04:00
|
|
|
|
2017-08-02 13:36:53 -04:00
|
|
|
`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|
|
2017-08-02 00:34:24 -04:00
|
|
|
|
2017-07-06 19:10:30 -04:00
|
|
|
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*
|
2017-04-13 05:27:09 -04:00
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be changed to alter the command-line arguments to the
|
|
|
|
gometalinter invocation.
|
|
|
|
|
2017-07-06 19:10:30 -04:00
|
|
|
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.
|
2017-05-30 08:39:22 -04:00
|
|
|
|
2017-04-27 17:04:34 -04:00
|
|
|
|
2018-04-27 13:49:33 -04:00
|
|
|
g:ale_go_gometalinter_lint_package *g:ale_go_gometalinter_lint_package*
|
|
|
|
*b:ale_go_gometalinter_lint_package*
|
2018-02-15 06:23:36 -05:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
2018-04-27 13:49:33 -04:00
|
|
|
g:ale_go_staticcheck_lint_package *g:ale_go_staticcheck_lint_package*
|
|
|
|
*b:ale_go_staticcheck_lint_package*
|
2018-02-15 06:23:36 -05:00
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, the whole Go package will be checked instead of only the
|
|
|
|
current file.
|
|
|
|
|
|
|
|
|
2018-08-29 22:39:03 -04:00
|
|
|
===============================================================================
|
|
|
|
golangserver *ale-go-golangserver*
|
|
|
|
|
|
|
|
g:ale_go_langserver_executable *g:ale_go_langserver_executable*
|
|
|
|
*b:ale_go_langserver_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'go-langserver'`
|
|
|
|
|
|
|
|
Location of the go-langserver binary file.
|
|
|
|
|
|
|
|
g:ale_go_langserver_options *g:ale_go_langserver_options*
|
|
|
|
*b:ale_go_langserver_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
Additional options passed to the go-langserver command. Note that the
|
|
|
|
`-gocodecompletion` option is ignored because it is handled automatically
|
|
|
|
by the |g:ale_completion_enabled| variable.
|
|
|
|
|
|
|
|
|
2018-09-06 15:31:12 -04:00
|
|
|
===============================================================================
|
|
|
|
golangci-lint *ale-go-golangci-lint*
|
|
|
|
|
|
|
|
`golangci-lint` 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_golangci_lint_executable *g:ale_go_golangci_lint_executable*
|
|
|
|
*b:ale_go_golangci_lint_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'golangci-lint'`
|
|
|
|
|
|
|
|
The executable that will be run for golangci-lint.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_golangci_lint_options *g:ale_go_golangci_lint_options*
|
|
|
|
*b:ale_go_golangci_lint_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'--enable-all'`
|
|
|
|
|
|
|
|
This variable can be changed to alter the command-line arguments to the
|
|
|
|
golangci-lint invocation.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_golangci_lint_package *g:ale_go_golangci_lint_package*
|
|
|
|
*b:ale_go_golangci_lint_package*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, the whole Go package will be checked instead of only the
|
|
|
|
current file.
|
|
|
|
|
|
|
|
|
2017-07-08 09:17:26 -04:00
|
|
|
===============================================================================
|
2017-04-13 05:27:09 -04:00
|
|
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|