summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-04-15 21:04:43 +0100
committerw0rp <devw0rp@gmail.com>2017-04-15 21:04:43 +0100
commitf0d76bc298778789072b87b73789141c750f1f50 (patch)
treef3039d3ae48eab6e4c2ebe16b15c4657a0cc0f8b
parent54991f3082108cb41e5be06a068e3e0472b858b9 (diff)
downloadale-f0d76bc298778789072b87b73789141c750f1f50.zip
Use g:ale_linters for turning gometalinter on, and update documentation as appropriate
-rw-r--r--ale_linters/go/gometalinter.vim13
-rw-r--r--autoload/ale/linter.vim1
-rw-r--r--doc/ale-go.txt12
-rw-r--r--doc/ale.txt4
4 files changed, 20 insertions, 10 deletions
diff --git a/ale_linters/go/gometalinter.vim b/ale_linters/go/gometalinter.vim
index 3a827fd3..8dbd8b26 100644
--- a/ale_linters/go/gometalinter.vim
+++ b/ale_linters/go/gometalinter.vim
@@ -1,20 +1,14 @@
" Author: Ben Reedy <https://github.com/breed808>
" Description: Adds support for the gometalinter suite for Go files
-" Disable gometalinter by default
-if !exists('g:ale_go_gometalinter_enabled')
- let g:ale_go_gometalinter_enabled = 0
-endif
-
if !exists('g:ale_go_gometalinter_options')
let g:ale_go_gometalinter_options = ''
endif
function! ale_linters#go#gometalinter#GetCommand(buffer) abort
- if g:ale_go_gometalinter_enabled == 1
- return 'gometalinter ' . g:ale_go_gometalinter_options . ' ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
- endif
- return ''
+ return 'gometalinter '
+ \ . g:ale_go_gometalinter_options
+ \ . ' ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
endfunction
function! ale_linters#go#gometalinter#Handler(buffer, lines) abort
@@ -49,6 +43,7 @@ function! ale_linters#go#gometalinter#Handler(buffer, lines) abort
\ 'nr': -1,
\})
endfor
+
return l:output
endfunction
diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim
index eec9cf15..8b31381c 100644
--- a/autoload/ale/linter.vim
+++ b/autoload/ale/linter.vim
@@ -22,6 +22,7 @@ let s:default_ale_linter_aliases = {
" Only cargo is enabled for Rust by default.
let s:default_ale_linters = {
\ 'csh': ['shell'],
+\ 'go': ['go build', 'gofmt', 'golint', 'gosimple', 'go vet', 'staticcheck'],
\ 'help': [],
\ 'rust': ['cargo'],
\ 'text': [],
diff --git a/doc/ale-go.txt b/doc/ale-go.txt
index e086bcd7..3ae82e80 100644
--- a/doc/ale-go.txt
+++ b/doc/ale-go.txt
@@ -3,6 +3,18 @@ ALE Go Integration *ale-go-options*
-------------------------------------------------------------------------------
+Integration Information
+
+The `gometalinter` linter is disabled by default, and all other Go linters
+supported by ALE are enabled by default. 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']}
+<
+
+-------------------------------------------------------------------------------
gometalinter *ale-go-gometalinter*
g:ale_go_gometalinter_enabled *g:ale_go_gometalinter_enabled*
diff --git a/doc/ale.txt b/doc/ale.txt
index 85409fc2..e3ecb43c 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -31,6 +31,8 @@ CONTENTS *ale-contents*
erlc................................|ale-erlang-erlc|
fortran...............................|ale-fortran-options|
gcc.................................|ale-fortran-gcc|
+ go....................................|ale-go-options|
+ gometalinter........................|ale-go-gometalinter|
handlebars............................|ale-handlebars-options|
ember-template-lint.................|ale-handlebars-embertemplatelint|
html..................................|ale-html-options|
@@ -123,7 +125,7 @@ The following languages and tools are supported.
* Elm: 'elm-make'
* Erlang: 'erlc'
* Fortran: 'gcc'
-* Go: 'gofmt -e', 'go vet', 'golint', 'go build', 'gosimple', 'staticcheck'
+* Go: 'gofmt', 'go vet', 'golint', 'go build', 'gosimple', 'staticcheck'
* Haml: 'hamllint'
* Handlebars: 'ember-template-lint'
* Haskell: 'ghc', 'hlint'