Merge pull request #1900 from McSwaggens/master
Fixed NASM linter from outputting junk file
This commit is contained in:
parent
9518ea9acc
commit
c76d8aa0b5
2 changed files with 5 additions and 3 deletions
|
@ -8,10 +8,12 @@ function! ale_linters#nasm#nasm#GetCommand(buffer) abort
|
||||||
" Note that NASM requires a trailing slash for the -I option.
|
" Note that NASM requires a trailing slash for the -I option.
|
||||||
let l:separator = has('win32') ? '\' : '/'
|
let l:separator = has('win32') ? '\' : '/'
|
||||||
let l:path = fnamemodify(bufname(a:buffer), ':p:h') . l:separator
|
let l:path = fnamemodify(bufname(a:buffer), ':p:h') . l:separator
|
||||||
|
let l:output_null = has('win32') ? 'NUL' : '/dev/null'
|
||||||
|
|
||||||
return '%e -X gnu -I ' . ale#Escape(l:path)
|
return '%e -X gnu -I ' . ale#Escape(l:path)
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'nasm_nasm_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'nasm_nasm_options'))
|
||||||
\ . ' %s'
|
\ . ' %s'
|
||||||
|
\ . ' -o ' . l:output_null
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#nasm#nasm#Handle(buffer, lines) abort
|
function! ale_linters#nasm#nasm#Handle(buffer, lines) abort
|
||||||
|
|
|
@ -2,9 +2,9 @@ Before:
|
||||||
call ale#assert#SetUpLinterTest('nasm', 'nasm')
|
call ale#assert#SetUpLinterTest('nasm', 'nasm')
|
||||||
|
|
||||||
let b:command_tail =
|
let b:command_tail =
|
||||||
\ ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' %s'
|
\ ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' %s -o ' . (has('win32') ? 'NUL' : '/dev/null')
|
||||||
let b:command_tail_opt =
|
let b:command_tail_opt =
|
||||||
\ ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' -w+orphan-labels %s'
|
\ ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' -w+orphan-labels %s -o ' . (has('win32') ? 'NUL' : '/dev/null')
|
||||||
|
|
||||||
After:
|
After:
|
||||||
unlet! b:command_tail
|
unlet! b:command_tail
|
||||||
|
@ -23,7 +23,7 @@ Execute(The options should be configurable):
|
||||||
let b:ale_nasm_nasm_options = '-w-macro-params'
|
let b:ale_nasm_nasm_options = '-w-macro-params'
|
||||||
|
|
||||||
AssertLinter 'nasm', ale#Escape('nasm')
|
AssertLinter 'nasm', ale#Escape('nasm')
|
||||||
\ . ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' -w-macro-params %s'
|
\ . ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' -w-macro-params %s -o ' . (has('win32') ? 'NUL' : '/dev/null')
|
||||||
|
|
||||||
Execute(The options should be used in command):
|
Execute(The options should be used in command):
|
||||||
let b:ale_nasm_nasm_options = '-w+orphan-labels'
|
let b:ale_nasm_nasm_options = '-w+orphan-labels'
|
||||||
|
|
Reference in a new issue