summaryrefslogtreecommitdiff
path: root/ale_linters/proto
diff options
context:
space:
mode:
authorJeff Willette <jrwillette88@gmail.com>2017-11-10 18:37:23 +0900
committerw0rp <w0rp@users.noreply.github.com>2017-11-10 09:37:23 +0000
commit27780cbb230fad55fbc07752febe5c21a69a18aa (patch)
tree3a88b32c4ba2d3b3c12efbfe10c61ed90e869c8b /ale_linters/proto
parentd425b8a18ab3c8155fdc7376192434f8878e954f (diff)
downloadale-27780cbb230fad55fbc07752febe5c21a69a18aa.zip
Added support for linting of proto files (#1098)
* Added support for linting of proto files * Added function to get the proper protoc command
Diffstat (limited to 'ale_linters/proto')
-rw-r--r--ale_linters/proto/protoc_gen_lint.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/ale_linters/proto/protoc_gen_lint.vim b/ale_linters/proto/protoc_gen_lint.vim
new file mode 100644
index 00000000..9d5ceacc
--- /dev/null
+++ b/ale_linters/proto/protoc_gen_lint.vim
@@ -0,0 +1,19 @@
+" 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',
+\})