2018-03-31 10:55:20 -04:00
|
|
|
===============================================================================
|
|
|
|
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
|
2019-01-08 05:11:54 -05:00
|
|
|
build`, `gosimple`, `golangserver`.
|
2018-03-31 10:55:20 -04:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2018-09-24 20:40:17 -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
|
2018-12-17 06:28:27 -05:00
|
|
|
the `gomod` fixer.
|
2018-09-24 20:40:17 -04:00
|
|
|
|
2018-03-31 10:55:20 -04:00
|
|
|
|
2019-08-22 11:36:17 -04:00
|
|
|
g:ale_go_go111module *g:ale_go_go111module*
|
|
|
|
*b:ale_go_go111module*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
Override the value of the `$GO111MODULE` environment variable for
|
|
|
|
golang tools.
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
===============================================================================
|
|
|
|
bingo *ale-go-bingo*
|
|
|
|
|
|
|
|
g:ale_go_bingo_executable *g:ale_go_bingo_executable*
|
|
|
|
*b:ale_go_bingo_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'bingo'`
|
|
|
|
|
|
|
|
Location of the bingo binary file.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_bingo_options *g:ale_go_bingo_options*
|
|
|
|
*b:ale_go_bingo_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
|
2018-03-31 10:55:20 -04: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".
|
|
|
|
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
2019-05-17 10:09:13 -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.
|
|
|
|
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
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-12-17 06:28:27 -05:00
|
|
|
===============================================================================
|
|
|
|
golint *ale-go-golint*
|
|
|
|
|
|
|
|
g:ale_go_golint_executable *g:ale_go_golint_executable*
|
|
|
|
*b:ale_go_golint_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'golint'`
|
|
|
|
|
|
|
|
This variable can be set to change the golint executable path.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_golint_options *g:ale_go_golint_options*
|
|
|
|
*b:ale_go_golint_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to pass additional options to the golint linter.
|
|
|
|
|
|
|
|
|
2018-03-31 10:55:20 -04:00
|
|
|
===============================================================================
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
2018-06-14 06:31:12 -04:00
|
|
|
g:ale_go_gometalinter_lint_package *g:ale_go_gometalinter_lint_package*
|
|
|
|
*b:ale_go_gometalinter_lint_package*
|
2018-03-31 10:55:20 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, the whole Go package will be checked instead of only the
|
|
|
|
current file.
|
|
|
|
|
|
|
|
|
|
|
|
===============================================================================
|
2019-05-17 10:09:13 -04:00
|
|
|
gopls *ale-go-gopls*
|
2018-03-31 10:55:20 -04:00
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
g:ale_go_gopls_executable *g:ale_go_gopls_executable*
|
|
|
|
*b:ale_go_gopls_executable*
|
2018-03-31 10:55:20 -04:00
|
|
|
Type: |String|
|
2019-05-17 10:09:13 -04:00
|
|
|
Default: `'gopls'`
|
2018-03-31 10:55:20 -04:00
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
Location of the gopls binary file.
|
2018-03-31 10:55:20 -04:00
|
|
|
|
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
g:ale_go_gopls_options *g:ale_go_gopls_options*
|
|
|
|
*b:ale_go_gopls_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
2018-03-31 10:55:20 -04:00
|
|
|
|
|
|
|
|
2018-09-24 20:40:17 -04:00
|
|
|
===============================================================================
|
2019-05-17 10:09:13 -04:00
|
|
|
govet *ale-go-govet*
|
2018-09-24 20:40:17 -04:00
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
g:ale_go_govet_options *g:ale_go_govet_options*
|
|
|
|
*b:ale_go_govet_options*
|
2018-09-24 20:40:17 -04:00
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
This variable can be set to pass additional options to the go vet linter.
|
2018-09-24 20:40:17 -04:00
|
|
|
|
|
|
|
|
2020-06-21 11:50:44 -04:00
|
|
|
===============================================================================
|
|
|
|
revive *ale-go-revive*
|
|
|
|
|
|
|
|
g:ale_go_revive_executable *g:ale_go_revive_executable*
|
|
|
|
*b:ale_go_revive_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'revive'`
|
|
|
|
|
|
|
|
This variable can be set to change the revive executable path.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_revive_options *g:ale_go_revive_options*
|
|
|
|
*b:ale_go_revive_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to pass additional options to the revive
|
|
|
|
|
|
|
|
|
2018-09-24 20:40:17 -04:00
|
|
|
===============================================================================
|
2019-05-17 10:09:13 -04:00
|
|
|
staticcheck *ale-go-staticcheck*
|
2018-09-24 20:40:17 -04:00
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
g:ale_go_staticcheck_options *g:ale_go_staticcheck_options*
|
|
|
|
*b:ale_go_staticcheck_options*
|
2018-09-24 20:40:17 -04:00
|
|
|
Type: |String|
|
2019-05-17 10:09:13 -04:00
|
|
|
Default: `''`
|
2018-09-24 20:40:17 -04:00
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
This variable can be set to pass additional options to the staticcheck
|
|
|
|
linter.
|
2018-09-24 20:40:17 -04:00
|
|
|
|
|
|
|
|
2019-05-17 10:09:13 -04:00
|
|
|
g:ale_go_staticcheck_lint_package *g:ale_go_staticcheck_lint_package*
|
|
|
|
*b:ale_go_staticcheck_lint_package*
|
2018-09-24 20:40:17 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, the whole Go package will be checked instead of only the
|
|
|
|
current file.
|
|
|
|
|
|
|
|
|
2018-03-31 10:55:20 -04:00
|
|
|
===============================================================================
|
|
|
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|