X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/ale_linters/proto/buf_lint.vim diff --git a/.vim/bundle/ale/ale_linters/proto/buf_lint.vim b/.vim/bundle/ale/ale_linters/proto/buf_lint.vim new file mode 100644 index 00000000..a22f8e53 --- /dev/null +++ b/.vim/bundle/ale/ale_linters/proto/buf_lint.vim @@ -0,0 +1,26 @@ +" Author: Alex McKinney +" Description: Run buf lint. + +call ale#Set('proto_buf_lint_executable', 'buf') +call ale#Set('proto_buf_lint_config', '') +call ale#Set('proto_buf_lint_options', '') + +function! ale_linters#proto#buf_lint#GetCommand(buffer) abort + let l:config = ale#Var(a:buffer, 'proto_buf_lint_config') + let l:options = ale#Var(a:buffer, 'proto_buf_lint_options') + + return '%e lint' + \ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '') + \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ' %s#include_package_files=true' +endfunction + +call ale#linter#Define('proto', { +\ 'name': 'buf_lint', +\ 'aliases': ['buf-lint'], +\ 'lint_file': 1, +\ 'output_stream': 'stdout', +\ 'executable': {b -> ale#Var(b, 'proto_buf_lint_executable')}, +\ 'command': function('ale_linters#proto#buf_lint#GetCommand'), +\ 'callback': 'ale#handlers#go#Handler', +\})