diff options
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/asm/gcc.vim | 12 | ||||
-rw-r--r-- | ale_linters/eruby/erb.vim | 2 | ||||
-rw-r--r-- | ale_linters/eruby/erubis.vim | 2 |
3 files changed, 11 insertions, 5 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', \}) diff --git a/ale_linters/eruby/erb.vim b/ale_linters/eruby/erb.vim index 5d0b4003..65de18ee 100644 --- a/ale_linters/eruby/erb.vim +++ b/ale_linters/eruby/erb.vim @@ -11,7 +11,7 @@ function! ale_linters#eruby#erb#GetCommand(buffer) abort " Rails-flavored eRuby does not comply with the standard as understood by " ERB, so we'll have to do some substitution. This does not reduce the " effectiveness of the linter—the translated code is still evaluated. - return 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . ' | ruby -c' + return 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c' endfunction call ale#linter#Define('eruby', { diff --git a/ale_linters/eruby/erubis.vim b/ale_linters/eruby/erubis.vim index ac356aeb..c9c8ac1e 100644 --- a/ale_linters/eruby/erubis.vim +++ b/ale_linters/eruby/erubis.vim @@ -11,7 +11,7 @@ function! ale_linters#eruby#erubis#GetCommand(buffer) abort " Rails-flavored eRuby does not comply with the standard as understood by " Erubis, so we'll have to do some substitution. This does not reduce the " effectiveness of the linter—the translated code is still evaluated. - return 'ruby -r erubis -e ' . ale#Escape('puts Erubis::Eruby.new($stdin.read.gsub(%{<%=},%{<%})).src') . ' | ruby -c' + return 'ruby -r erubis -e ' . ale#Escape('puts Erubis::Eruby.new($stdin.read.gsub(%{<%=},%{<%})).src') . '< %t | ruby -c' endfunction call ale#linter#Define('eruby', { |