thrift: default thrift_thrift_includes to ['.']

In a lint context, it's useful to assume that included files sit next to
the current file by default. Users can still further customize this
configuration variable to add more include paths.
This commit is contained in:
Jon Parise 2018-09-14 14:56:15 -07:00
parent f1f2a22228
commit b7fcec4d17
3 changed files with 7 additions and 7 deletions

View file

@ -2,7 +2,7 @@
call ale#Set('thrift_thrift_executable', 'thrift') call ale#Set('thrift_thrift_executable', 'thrift')
call ale#Set('thrift_thrift_generators', ['cpp']) call ale#Set('thrift_thrift_generators', ['cpp'])
call ale#Set('thrift_thrift_includes', []) call ale#Set('thrift_thrift_includes', ['.'])
call ale#Set('thrift_thrift_options', '-strict') call ale#Set('thrift_thrift_options', '-strict')
function! ale_linters#thrift#thrift#GetCommand(buffer) abort function! ale_linters#thrift#thrift#GetCommand(buffer) abort

View file

@ -28,7 +28,7 @@ g:ale_thrift_thrift_generators *g:ale_thrift_thrift_generators*
g:ale_thrift_thrift_includes *g:ale_thrift_thrift_includes* g:ale_thrift_thrift_includes *g:ale_thrift_thrift_includes*
*b:ale_thrift_thrift_includes* *b:ale_thrift_thrift_includes*
Type: |List| of |String|s Type: |List| of |String|s
Default: `[]` Default: `['.']`
This list contains paths that will be searched for thrift `include` This list contains paths that will be searched for thrift `include`
directives. directives.

View file

@ -23,22 +23,22 @@ After:
call ale#assert#TearDownLinterTest() call ale#assert#TearDownLinterTest()
Execute(The default command should be correct): Execute(The default command should be correct):
AssertLinter 'thrift', ale#Escape('thrift') . ' --gen cpp -strict' . b:suffix AssertLinter 'thrift', ale#Escape('thrift') . ' --gen cpp -I . -strict' . b:suffix
Execute(The executable should be configurable): Execute(The executable should be configurable):
let b:ale_thrift_thrift_executable = 'foobar' let b:ale_thrift_thrift_executable = 'foobar'
AssertLinter 'foobar', ale#Escape('foobar') . ' --gen cpp -strict' . b:suffix AssertLinter 'foobar', ale#Escape('foobar') . ' --gen cpp -I . -strict' . b:suffix
Execute(The list of generators should be configurable): Execute(The list of generators should be configurable):
let b:ale_thrift_thrift_generators = ['java', 'py:dynamic'] let b:ale_thrift_thrift_generators = ['java', 'py:dynamic']
AssertLinter 'thrift', ale#Escape('thrift') AssertLinter 'thrift', ale#Escape('thrift')
\ . ' --gen java --gen py:dynamic -strict' . b:suffix \ . ' --gen java --gen py:dynamic -I . -strict' . b:suffix
let b:ale_thrift_thrift_generators = [] let b:ale_thrift_thrift_generators = []
AssertLinter 'thrift', ale#Escape('thrift') . ' --gen cpp -strict' . b:suffix AssertLinter 'thrift', ale#Escape('thrift') . ' --gen cpp -I . -strict' . b:suffix
Execute(The list of include paths should be configurable): Execute(The list of include paths should be configurable):
let b:ale_thrift_thrift_includes = ['included/path'] let b:ale_thrift_thrift_includes = ['included/path']
@ -50,4 +50,4 @@ Execute(The string of compiler options should be configurable):
let b:ale_thrift_thrift_options = '-strict --allow-64bit-consts' let b:ale_thrift_thrift_options = '-strict --allow-64bit-consts'
AssertLinter 'thrift', ale#Escape('thrift') AssertLinter 'thrift', ale#Escape('thrift')
\ . ' --gen cpp -strict --allow-64bit-consts' . b:suffix \ . ' --gen cpp -I . -strict --allow-64bit-consts' . b:suffix