mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Removed syntastic and replaced it with ale
Read more here: https://github.com/w0rp/ale
This commit is contained in:
27
sources_non_forked/ale/ale_linters/proto/protoc_gen_lint.vim
Normal file
27
sources_non_forked/ale/ale_linters/proto/protoc_gen_lint.vim
Normal file
@ -0,0 +1,27 @@
|
||||
" 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')
|
||||
|
||||
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', {
|
||||
\ 'name': 'protoc-gen-lint',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'protoc',
|
||||
\ 'command_callback': 'ale_linters#proto#protoc_gen_lint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
Reference in New Issue
Block a user