diff options
author | w0rp <devw0rp@gmail.com> | 2018-07-15 18:24:53 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-07-15 18:28:28 +0100 |
commit | a42999a639b2916b769a85f37d037be314d9d61b (patch) | |
tree | 5ebfb4d357dc673efa93fd32a66b489c4510de40 /ale_linters/cs | |
parent | 5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff) | |
download | ale-a42999a639b2916b769a85f37d037be314d9d61b.zip |
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'ale_linters/cs')
-rw-r--r-- | ale_linters/cs/mcs.vim | 6 | ||||
-rw-r--r-- | ale_linters/cs/mcsc.vim | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/ale_linters/cs/mcs.vim b/ale_linters/cs/mcs.vim index b5c4054a..8738026d 100644 --- a/ale_linters/cs/mcs.vim +++ b/ale_linters/cs/mcs.vim @@ -1,7 +1,11 @@ let g:ale_cs_mcs_options = get(g:, 'ale_cs_mcs_options', '') function! ale_linters#cs#mcs#GetCommand(buffer) abort - return 'mcs -unsafe --parse ' . ale#Var(a:buffer, 'cs_mcs_options') . ' %t' + let l:options = ale#Var(a:buffer, 'cs_mcs_options') + + return 'mcs -unsafe --parse' + \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ' %t' endfunction function! ale_linters#cs#mcs#Handle(buffer, lines) abort diff --git a/ale_linters/cs/mcsc.vim b/ale_linters/cs/mcsc.vim index 8e84620c..1561661e 100644 --- a/ale_linters/cs/mcsc.vim +++ b/ale_linters/cs/mcsc.vim @@ -29,16 +29,16 @@ function! ale_linters#cs#mcsc#GetCommand(buffer) abort \ : '' " register temporary module target file with ale - let l:out = ale#util#Tempname() - call ale#engine#ManageFile(a:buffer, l:out) + " register temporary module target file with ALE. + let l:out = ale#engine#CreateFile(a:buffer) " The code is compiled as a module and the output is redirected to a " temporary file. return ale#path#CdString(s:GetWorkingDirectory(a:buffer)) \ . 'mcs -unsafe' - \ . ' ' . ale#Var(a:buffer, 'cs_mcsc_options') - \ . ' ' . l:lib_option - \ . ' ' . l:r_option + \ . ale#Pad(ale#Var(a:buffer, 'cs_mcsc_options')) + \ . ale#Pad(l:lib_option) + \ . ale#Pad(l:r_option) \ . ' -out:' . l:out \ . ' -t:module' \ . ' -recurse:' . ale#Escape('*.cs') |