summaryrefslogtreecommitdiff
path: root/ale_linters/c
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-29 19:24:19 +0100
committerw0rp <devw0rp@gmail.com>2018-07-29 19:24:27 +0100
commitac4bac8ea4c5a8d520041ad509e10af454fcfce4 (patch)
tree87a57a03149b62116b8e1b6fa96117e5e3186626 /ale_linters/c
parenta7b8cb4fe32b43dbeeadc8cb94f378b4e2112723 (diff)
downloadale-ac4bac8ea4c5a8d520041ad509e10af454fcfce4.zip
Add support for parsing compile_commands.json files for C compilers
Diffstat (limited to 'ale_linters/c')
-rw-r--r--ale_linters/c/clang.vim8
-rw-r--r--ale_linters/c/clangtidy.vim2
-rw-r--r--ale_linters/c/gcc.vim8
3 files changed, 9 insertions, 9 deletions
diff --git a/ale_linters/c/clang.vim b/ale_linters/c/clang.vim
index ddec4fcb..48ea76dd 100644
--- a/ale_linters/c/clang.vim
+++ b/ale_linters/c/clang.vim
@@ -14,10 +14,10 @@ function! ale_linters#c#clang#GetCommand(buffer, output) abort
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
return ale#Escape(ale_linters#c#clang#GetExecutable(a:buffer))
- \ . ' -S -x c -fsyntax-only '
- \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
- \ . l:cflags
- \ . ale#Var(a:buffer, 'c_clang_options') . ' -'
+ \ . ' -S -x c -fsyntax-only'
+ \ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
+ \ . ale#Pad(l:cflags)
+ \ . ale#Pad(ale#Var(a:buffer, 'c_clang_options')) . ' -'
endfunction
call ale#linter#Define('c', {
diff --git a/ale_linters/c/clangtidy.vim b/ale_linters/c/clangtidy.vim
index 47faa1ef..d456a5a2 100644
--- a/ale_linters/c/clangtidy.vim
+++ b/ale_linters/c/clangtidy.vim
@@ -35,7 +35,7 @@ function! s:GetBuildDirectory(buffer) abort
return l:build_dir
endif
- return ale#c#FindCompileCommands(a:buffer)
+ return ale#path#Dirname(ale#c#FindCompileCommands(a:buffer))
endfunction
function! ale_linters#c#clangtidy#GetCommand(buffer) abort
diff --git a/ale_linters/c/gcc.vim b/ale_linters/c/gcc.vim
index 98563952..63fe87a6 100644
--- a/ale_linters/c/gcc.vim
+++ b/ale_linters/c/gcc.vim
@@ -14,10 +14,10 @@ function! ale_linters#c#gcc#GetCommand(buffer, output) abort
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
return ale#Escape(ale_linters#c#gcc#GetExecutable(a:buffer))
- \ . ' -S -x c -fsyntax-only '
- \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
- \ . l:cflags
- \ . ale#Var(a:buffer, 'c_gcc_options') . ' -'
+ \ . ' -S -x c -fsyntax-only'
+ \ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
+ \ . ale#Pad(l:cflags)
+ \ . ale#Pad(ale#Var(a:buffer, 'c_gcc_options')) . ' -'
endfunction
call ale#linter#Define('c', {