diff options
author | Thomas van der Burgt <thvdburgt@users.noreply.github.com> | 2017-11-17 11:02:30 +0100 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2017-11-17 10:02:30 +0000 |
commit | 22ec81e1de48cf442238dac9f85a579e04bf70cb (patch) | |
tree | ac057bb694b5ff5478177ecfbfb666b67d8deed1 /ale_linters/asm/gcc.vim | |
parent | a139b387c818a5bf05ed38381a99341aa9950aba (diff) | |
download | ale-22ec81e1de48cf442238dac9f85a579e04bf70cb.zip |
add ale_asm_gcc_executable option (#1138)
* add ale_asm_gcc_executable option
* add Vader tests for asm gcc linter command callbacks
Diffstat (limited to 'ale_linters/asm/gcc.vim')
-rw-r--r-- | ale_linters/asm/gcc.vim | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ale_linters/asm/gcc.vim b/ale_linters/asm/gcc.vim index 39b1f7c2..4ac876f8 100644 --- a/ale_linters/asm/gcc.vim +++ b/ale_linters/asm/gcc.vim @@ -1,10 +1,16 @@ " Author: Lucas Kolstad <lkolstad@uw.edu> " Description: gcc linter for asm files -let g:ale_asm_gcc_options = get(g:, 'ale_asm_gcc_options', '-Wall') +call ale#Set('asm_gcc_executable', 'gcc') +call ale#Set('asm_gcc_options', '-Wall') + +function! ale_linters#asm#gcc#GetExecutable(buffer) abort + return ale#Var(a:buffer, 'asm_gcc_executable') +endfunction function! ale_linters#asm#gcc#GetCommand(buffer) abort - return 'gcc -x assembler -fsyntax-only ' + return ale#Escape(ale_linters#asm#gcc#GetExecutable(a:buffer)) + \ . ' -x assembler -fsyntax-only ' \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) \ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -' endfunction @@ -27,7 +33,7 @@ endfunction call ale#linter#Define('asm', { \ 'name': 'gcc', \ 'output_stream': 'stderr', -\ 'executable': 'gcc', +\ 'executable_callback': 'ale_linters#asm#gcc#GetExecutable', \ 'command_callback': 'ale_linters#asm#gcc#GetCommand', \ 'callback': 'ale_linters#asm#gcc#Handle', \}) |