summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorMartino Pilia <martino.pilia@gmail.com>2018-11-12 00:54:24 +0100
committerMartino Pilia <martino.pilia@gmail.com>2018-11-12 00:54:24 +0100
commit9e8f2b08401af5af83b181a0ca5419937f3fd0de (patch)
treeb8adf70a39032c82779da00f73aaafafaec4ea38 /ale_linters
parent0b4507ed565a53ad884dd9c7a0042daa4c782ae4 (diff)
downloadale-9e8f2b08401af5af83b181a0ca5419937f3fd0de.zip
Lint ispc on disk to solve include imprecisions
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/ispc/ispc.vim10
1 files changed, 4 insertions, 6 deletions
diff --git a/ale_linters/ispc/ispc.vim b/ale_linters/ispc/ispc.vim
index 283cfdff..b5f33f5b 100644
--- a/ale_linters/ispc/ispc.vim
+++ b/ale_linters/ispc/ispc.vim
@@ -4,14 +4,11 @@
call ale#Set('ispc_ispc_executable', 'ispc')
call ale#Set('ispc_ispc_options', '')
-" ISPC has no equivalent of gcc's -iquote argument, so use a -I for headers
-" in the same directory. Not perfect, since now local headers are accepted
-" by #include<> while they should not, but better than nothing.
function! ale_linters#ispc#ispc#GetCommand(buffer) abort
- return '%e '
- \ . '-I ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
+ return '%e'
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
- \ . ale#Pad(ale#Var(a:buffer, 'ispc_ispc_options')) . ' -'
+ \ . ale#Pad(ale#Var(a:buffer, 'ispc_ispc_options'))
+ \ . ' %s'
endfunction
" Note that we ignore the two warnings in the beginning of the compiler output
@@ -65,4 +62,5 @@ call ale#linter#Define('ispc', {
\ 'executable_callback': ale#VarFunc('ispc_ispc_executable'),
\ 'command_callback': 'ale_linters#ispc#ispc#GetCommand',
\ 'callback': 'ale_linters#ispc#ispc#Handle',
+\ 'lint_file': 1,
\})