summaryrefslogtreecommitdiff
path: root/ale_linters/c
diff options
context:
space:
mode:
authorroel0 <roel.postelmans@altran.com>2018-03-21 20:44:35 +0100
committerroel0 <roel.postelmans@altran.com>2018-03-21 20:44:35 +0100
commit69237a7e57a67e37e8dcd0c3d97b4a6ffda5929a (patch)
treedc3d86a1932dc7aea035a31ef49df27c55dc041a /ale_linters/c
parent7593e2037741fa264aa4029529180cc152c802b6 (diff)
downloadale-69237a7e57a67e37e8dcd0c3d97b4a6ffda5929a.zip
Added additional unit tests + adapted review comments #1167
Diffstat (limited to 'ale_linters/c')
-rw-r--r--ale_linters/c/clang.vim12
-rw-r--r--ale_linters/c/gcc.vim12
2 files changed, 4 insertions, 20 deletions
diff --git a/ale_linters/c/clang.vim b/ale_linters/c/clang.vim
index 01e92476..ddec4fcb 100644
--- a/ale_linters/c/clang.vim
+++ b/ale_linters/c/clang.vim
@@ -9,15 +9,7 @@ function! ale_linters#c#clang#GetExecutable(buffer) abort
endfunction
function! ale_linters#c#clang#GetCommand(buffer, output) abort
- let l:cflags = []
- if !empty(a:output)
- let l:cflags = join(ale#c#ParseMakefile(a:buffer, join(a:output, '\n')), ' ')
- endif
- if empty(l:cflags)
- let l:cflags = ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer))
- else
- let l:cflags .= ' '
- endif
+ let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
@@ -33,7 +25,7 @@ call ale#linter#Define('c', {
\ 'output_stream': 'stderr',
\ 'executable_callback': 'ale_linters#c#clang#GetExecutable',
\ 'command_chain': [
-\ {'callback': 'ale#c#ParseMakefile', 'output_stream': 'stdout'},
+\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
\ {'callback': 'ale_linters#c#clang#GetCommand'}
\ ],
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
diff --git a/ale_linters/c/gcc.vim b/ale_linters/c/gcc.vim
index 155c5dd2..98563952 100644
--- a/ale_linters/c/gcc.vim
+++ b/ale_linters/c/gcc.vim
@@ -9,15 +9,7 @@ function! ale_linters#c#gcc#GetExecutable(buffer) abort
endfunction
function! ale_linters#c#gcc#GetCommand(buffer, output) abort
- let l:cflags = []
- if !empty(a:output)
- let l:cflags = join(ale#c#ParseCFlags(a:buffer, join(a:output, '\n')), ' ')
- endif
- if empty(l:cflags)
- let l:cflags = ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer))
- else
- let l:cflags .= ' '
- endif
+ let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
@@ -33,7 +25,7 @@ call ale#linter#Define('c', {
\ 'output_stream': 'stderr',
\ 'executable_callback': 'ale_linters#c#gcc#GetExecutable',
\ 'command_chain': [
-\ {'callback': 'ale#c#ParseMakefile', 'output_stream': 'stdout'},
+\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
\ {'callback': 'ale_linters#c#gcc#GetCommand'}
\ ],
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',