mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
* Shell commands should by called async with the help of a command chain
* The makefile parser unit test should only test the cflag parser itself #1167
This commit is contained in:
@@ -3,16 +3,15 @@
|
||||
|
||||
call ale#Set('c_clang_executable', 'clang')
|
||||
call ale#Set('c_clang_options', '-std=c11 -Wall')
|
||||
call ale#Set('c_clang_parse_makefile', 0)
|
||||
|
||||
function! ale_linters#c#clang#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'c_clang_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#clang#GetCommand(buffer) abort
|
||||
let l:cflags = []
|
||||
if g:ale_c_clang_parse_makefile
|
||||
let l:cflags = join(ale#c#ParseMakefile(a:buffer), ' ')
|
||||
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))
|
||||
@@ -33,6 +32,9 @@ call ale#linter#Define('c', {
|
||||
\ 'name': 'clang',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#c#clang#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#c#clang#GetCommand',
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#ParseMakefile', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#c#clang#GetCommand'}
|
||||
\ ],
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\})
|
||||
|
||||
@@ -3,16 +3,15 @@
|
||||
|
||||
call ale#Set('c_gcc_executable', 'gcc')
|
||||
call ale#Set('c_gcc_options', '-std=c11 -Wall')
|
||||
call ale#Set('c_gcc_parse_makefile', 0)
|
||||
|
||||
function! ale_linters#c#gcc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'c_gcc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#gcc#GetCommand(buffer) abort
|
||||
function! ale_linters#c#gcc#GetCommand(buffer, output) abort
|
||||
let l:cflags = []
|
||||
if g:ale_c_gcc_parse_makefile
|
||||
let l:cflags = join(ale#c#ParseMakefile(a:buffer), ' ')
|
||||
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))
|
||||
@@ -33,6 +32,9 @@ call ale#linter#Define('c', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#c#gcc#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#c#gcc#GetCommand',
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#ParseMakefile', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#c#gcc#GetCommand'}
|
||||
\ ],
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\})
|
||||
|
||||
Reference in New Issue
Block a user