summaryrefslogtreecommitdiff
path: root/ale_linters/go
diff options
context:
space:
mode:
authorBartek thindil Jasicki <thindil@laeran.pl>2020-06-07 09:26:06 +0200
committerBartek thindil Jasicki <thindil@laeran.pl>2020-06-07 09:26:06 +0200
commita5e7f2c8bb61f3e882bc26ce1773b130d1fbc32b (patch)
treecb85bc818b667acc9b28870755e079e20b935a3f /ale_linters/go
parentb6828ac5c54c809336b5314e51f185124d90b23f (diff)
parent7265ceb6d050d1a4642741d248f11e4f2abd37e1 (diff)
downloadale-a5e7f2c8bb61f3e882bc26ce1773b130d1fbc32b.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'ale_linters/go')
-rw-r--r--ale_linters/go/revive.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/ale_linters/go/revive.vim b/ale_linters/go/revive.vim
new file mode 100644
index 00000000..b14b5ab9
--- /dev/null
+++ b/ale_linters/go/revive.vim
@@ -0,0 +1,21 @@
+" Author: Penghui Liao <liaoishere@gmail.com>
+" Description: Adds support for revive
+
+call ale#Set('go_revive_executable', 'revive')
+call ale#Set('go_revive_options', '')
+
+function! ale_linters#go#revive#GetCommand(buffer) abort
+ let l:options = ale#Var(a:buffer, 'go_revive_options')
+
+ return ale#go#EnvString(a:buffer) . '%e'
+ \ . (!empty(l:options) ? ' ' . l:options : '')
+ \ . ' %t'
+endfunction
+
+call ale#linter#Define('go', {
+\ 'name': 'revive',
+\ 'output_stream': 'both',
+\ 'executable': {b -> ale#Var(b, 'go_revive_executable')},
+\ 'command': function('ale_linters#go#revive#GetCommand'),
+\ 'callback': 'ale#handlers#unix#HandleAsWarning',
+\})