summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-01-12 20:43:43 +0000
committerGitHub <noreply@github.com>2018-01-12 20:43:43 +0000
commitf6af75aac46f2d4ac72ea8256ac871f7cbf158f6 (patch)
tree984394716f10a5198d6c282541008049e2b80c42 /ale_linters
parente18aba1d7e82c1baf5654312d4d42787e4ecd42e (diff)
parentb5a5cdf920a9875650b021c8116ac02b739a9e9e (diff)
downloadale-f6af75aac46f2d4ac72ea8256ac871f7cbf158f6.zip
Merge pull request #1268 from bbannier/master
Make it possible to inject flags of protoc invocation.
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/proto/protoc_gen_lint.vim14
1 files changed, 11 insertions, 3 deletions
diff --git a/ale_linters/proto/protoc_gen_lint.vim b/ale_linters/proto/protoc_gen_lint.vim
index 9d5ceacc..c8b5c331 100644
--- a/ale_linters/proto/protoc_gen_lint.vim
+++ b/ale_linters/proto/protoc_gen_lint.vim
@@ -1,12 +1,20 @@
" Author: Jeff Willette <jrwillette88@gmail.com>
" Description: run the protoc-gen-lint plugin for the protoc binary
+call ale#Set('proto_protoc_gen_lint_options', '')
+
function! ale_linters#proto#protoc_gen_lint#GetCommand(buffer) abort
let l:dirname = expand('#' . a:buffer . ':p:h')
- return 'protoc'
- \ . ' -I ' . ale#Escape(l:dirname)
- \ . ' --lint_out=. ' . '%s'
+ let l:options = ['-I ' . ale#Escape(l:dirname)]
+
+ if !empty(ale#Var(a:buffer, 'proto_protoc_gen_lint_options'))
+ let l:options += [ale#Var(a:buffer, 'proto_protoc_gen_lint_options')]
+ endif
+
+ let l:options += ['--lint_out=. ' . '%s']
+
+ return 'protoc' . ' ' . join(l:options)
endfunction
call ale#linter#Define('proto', {