mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-26 05:51:08 +08:00
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.
This commit is contained in:
@@ -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(''))
|
||||
|
||||
Reference in New Issue
Block a user