summaryrefslogtreecommitdiff
path: root/test/command_callback/test_proto_command_callback.vader
diff options
context:
space:
mode:
authorBenjamin Bannier <bbannier@gmail.com>2018-01-06 20:56:28 +0100
committerBenjamin Bannier <bbannier@gmail.com>2018-01-07 17:56:56 +0100
commitb5a5cdf920a9875650b021c8116ac02b739a9e9e (patch)
tree34742878de3544cf25b27c57f3a6fd16ef7c590b /test/command_callback/test_proto_command_callback.vader
parenteecbacb742f0e884e2f47f0aee57caf9cb2dd683 (diff)
downloadale-b5a5cdf920a9875650b021c8116ac02b739a9e9e.zip
Make it possible to inject flags of protoc invocation.
Typically proto files depend on and make use of proto definitions in other files. When invoking protoc user can supply paths to inspect for dependencies. This patch makes it possible to configure flags passed to protoc. This makes it e.g., possible to change include paths of the linter's protoc invocation.
Diffstat (limited to 'test/command_callback/test_proto_command_callback.vader')
-rw-r--r--test/command_callback/test_proto_command_callback.vader9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/command_callback/test_proto_command_callback.vader b/test/command_callback/test_proto_command_callback.vader
index 79c1cf80..76050c61 100644
--- a/test/command_callback/test_proto_command_callback.vader
+++ b/test/command_callback/test_proto_command_callback.vader
@@ -4,9 +4,18 @@ Before:
After:
Restore
+ unlet! b:ale_proto_protoc_gen_lint_options
+
call ale#linter#Reset()
Execute(The default command should be correct):
AssertEqual
\ 'protoc' . ' -I ' . ale#Escape(getcwd()) . ' --lint_out=. ' . '%s',
\ ale_linters#proto#protoc_gen_lint#GetCommand(bufnr(''))
+
+Execute(The callback should include any additional options):
+ let b:ale_proto_protoc_gen_lint_options = '--some-option'
+
+ AssertEqual
+ \ 'protoc' . ' -I ' . ale#Escape(getcwd()) . ' --some-option --lint_out=. ' . '%s',
+ \ ale_linters#proto#protoc_gen_lint#GetCommand(bufnr(''))