mirror of
https://github.com/dense-analysis/ale
synced 2024-12-25 23:52:22 +00:00
27780cbb23
* Added support for linting of proto files * Added function to get the proper protoc command
20 lines
619 B
VimL
20 lines
619 B
VimL
" Author: Jeff Willette <jrwillette88@gmail.com>
|
|
" Description: run the protoc-gen-lint plugin for the protoc binary
|
|
|
|
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'
|
|
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',
|
|
\})
|