summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/go/gobuild.vim17
-rw-r--r--ale_linters/go/govet.vim21
-rw-r--r--ale_linters/handlebars/embertemplatelint.vim7
-rw-r--r--ale_linters/v/v.vim17
4 files changed, 18 insertions, 44 deletions
diff --git a/ale_linters/go/gobuild.vim b/ale_linters/go/gobuild.vim
index 5210c5a8..0342a230 100644
--- a/ale_linters/go/gobuild.vim
+++ b/ale_linters/go/gobuild.vim
@@ -6,16 +6,6 @@
call ale#Set('go_go_executable', 'go')
call ale#Set('go_gobuild_options', '')
-function! ale_linters#go#gobuild#GetCommand(buffer) abort
- let l:options = ale#Var(a:buffer, 'go_gobuild_options')
-
- " Run go test in local directory with relative path
- return ale#go#EnvString(a:buffer)
- \ . ale#Var(a:buffer, 'go_go_executable') . ' test'
- \ . (!empty(l:options) ? ' ' . l:options : '')
- \ . ' -c -o /dev/null ./'
-endfunction
-
function! ale_linters#go#gobuild#GetMatches(lines) abort
" Matches patterns like the following:
"
@@ -50,7 +40,12 @@ call ale#linter#Define('go', {
\ 'aliases': ['go build'],
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
-\ 'command': function('ale_linters#go#gobuild#GetCommand'),
+\ 'command': {b ->
+\ ale#go#EnvString(b)
+\ . ale#Escape(ale#Var(b, 'go_go_executable')) . ' test'
+\ . ale#Pad(ale#Var(b, 'go_gobuild_options'))
+\ . ' -c -o /dev/null ./'
+\ },
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#go#gobuild#Handler',
\ 'lint_file': 1,
diff --git a/ale_linters/go/govet.vim b/ale_linters/go/govet.vim
index 5da8261c..414c8b11 100644
--- a/ale_linters/go/govet.vim
+++ b/ale_linters/go/govet.vim
@@ -1,28 +1,21 @@
-" Author: neersighted <bjorn@neersighted.com>
+" Author: neersighted <bjorn@neersighted.com>, John Eikenberry <jae@zhar.net>
" Description: go vet for Go files
-"
-" Author: John Eikenberry <jae@zhar.net>
-" Description: updated to work with go1.10
call ale#Set('go_go_executable', 'go')
call ale#Set('go_govet_options', '')
-function! ale_linters#go#govet#GetCommand(buffer) abort
- let l:options = ale#Var(a:buffer, 'go_govet_options')
-
- return ale#go#EnvString(a:buffer)
- \ . ale#Var(a:buffer, 'go_go_executable') . ' vet '
- \ . (!empty(l:options) ? ' ' . l:options : '')
- \ . ' .'
-endfunction
-
call ale#linter#Define('go', {
\ 'name': 'govet',
\ 'aliases': ['go vet'],
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
-\ 'command': function('ale_linters#go#govet#GetCommand'),
+\ 'command': {b ->
+\ ale#go#EnvString(b)
+\ . '%e vet'
+\ . ale#Pad(ale#Var(b, 'go_govet_options'))
+\ . ' .'
+\ },
\ 'callback': 'ale#handlers#go#Handler',
\ 'lint_file': 1,
\})
diff --git a/ale_linters/handlebars/embertemplatelint.vim b/ale_linters/handlebars/embertemplatelint.vim
index 17c4d08e..14fa3b2e 100644
--- a/ale_linters/handlebars/embertemplatelint.vim
+++ b/ale_linters/handlebars/embertemplatelint.vim
@@ -16,12 +16,7 @@ function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) a
return '%e --format=json --filename %s'
endif
- if ale#semver#GTE(a:version, [1, 6, 0])
- " Reading from stdin was introduced in ember-template-lint@1.6.0
- return '%e --json --filename %s'
- endif
-
- return '%e --json %t'
+ return '%e --json --filename %s'
endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
diff --git a/ale_linters/v/v.vim b/ale_linters/v/v.vim
index afa98c56..dfe6f562 100644
--- a/ale_linters/v/v.vim
+++ b/ale_linters/v/v.vim
@@ -4,17 +4,6 @@
call ale#Set('v_v_executable', 'v')
call ale#Set('v_v_options', '')
-function! ale_linters#v#v#GetCommand(buffer) abort
- let l:options = ale#Var(a:buffer, 'v_v_options')
-
- " Run v in local directory with relative path
- let l:command = ale#Var(a:buffer, 'v_v_executable')
- \ . ale#Pad(l:options)
- \ . ' .' . ' -o /tmp/vim-ale-v'
-
- return l:command
-endfunction
-
function! ale_linters#v#v#Handler(buffer, lines) abort
let l:dir = expand('#' . a:buffer . ':p:h')
let l:output = []
@@ -73,9 +62,11 @@ endfunction
call ale#linter#Define('v', {
\ 'name': 'v',
-\ 'aliases': [],
\ 'executable': {b -> ale#Var(b, 'v_v_executable')},
-\ 'command': function('ale_linters#v#v#GetCommand'),
+\ 'command': {b ->
+\ '%e' . ale#Pad(ale#Var(b, 'v_v_options'))
+\ . ' . -o /tmp/vim-ale-v'
+\ },
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#v#v#Handler',
\ 'lint_file': 1,