summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Parise <jon@indelible.org>2018-09-14 14:56:15 -0700
committerJon Parise <jon@indelible.org>2018-09-16 08:21:18 -0700
commitb7fcec4d177f99f56f543830c7b51f18c3b3a4a0 (patch)
treee4a8cd98cdffd7ea3e11b99a7e9dd81464dc1025
parentf1f2a222281c9e489c3ca6a4f72329c08d4646a6 (diff)
downloadale-b7fcec4d177f99f56f543830c7b51f18c3b3a4a0.zip
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.
-rw-r--r--ale_linters/thrift/thrift.vim2
-rw-r--r--doc/ale-thrift.txt2
-rw-r--r--test/command_callback/test_thrift_command_callback.vader10
3 files changed, 7 insertions, 7 deletions
diff --git a/ale_linters/thrift/thrift.vim b/ale_linters/thrift/thrift.vim
index 396a2355..36a8656e 100644
--- a/ale_linters/thrift/thrift.vim
+++ b/ale_linters/thrift/thrift.vim
@@ -2,7 +2,7 @@
call ale#Set('thrift_thrift_executable', 'thrift')
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')
function! ale_linters#thrift#thrift#GetCommand(buffer) abort
diff --git a/doc/ale-thrift.txt b/doc/ale-thrift.txt
index ed858db8..bb2ec058 100644
--- a/doc/ale-thrift.txt
+++ b/doc/ale-thrift.txt
@@ -28,7 +28,7 @@ g:ale_thrift_thrift_generators *g:ale_thrift_thrift_generators*
g:ale_thrift_thrift_includes *g:ale_thrift_thrift_includes*
*b:ale_thrift_thrift_includes*
Type: |List| of |String|s
- Default: `[]`
+ Default: `['.']`
This list contains paths that will be searched for thrift `include`
directives.
diff --git a/test/command_callback/test_thrift_command_callback.vader b/test/command_callback/test_thrift_command_callback.vader
index ea217259..cbada818 100644
--- a/test/command_callback/test_thrift_command_callback.vader
+++ b/test/command_callback/test_thrift_command_callback.vader
@@ -23,22 +23,22 @@ After:
call ale#assert#TearDownLinterTest()
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):
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):
let b:ale_thrift_thrift_generators = ['java', 'py:dynamic']
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 = []
- 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):
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'
AssertLinter 'thrift', ale#Escape('thrift')
- \ . ' --gen cpp -strict --allow-64bit-consts' . b:suffix
+ \ . ' --gen cpp -I . -strict --allow-64bit-consts' . b:suffix