Fix 3498 - Change standardrb fixer to read from stdin.

Seems standardrb fails to properly use the --config option when using
temporary files but works fine when reading from stdin. This commit
changes the fixer so it uses stdin instead of temporary files.
This commit is contained in:
Horacio Sanson 2021-01-06 10:37:48 +09:00
parent a1e6df987c
commit 7fe61cdf0e

View file

@ -12,12 +12,12 @@ function! ale#fixers#standardrb#GetCommand(buffer) abort
return ale#ruby#EscapeExecutable(l:executable, 'standardrb') return ale#ruby#EscapeExecutable(l:executable, 'standardrb')
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '') \ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --fix --force-exclusion %t' \ . ' --fix --force-exclusion --stdin %s'
endfunction endfunction
function! ale#fixers#standardrb#Fix(buffer) abort function! ale#fixers#standardrb#Fix(buffer) abort
return { return {
\ 'command': ale#fixers#standardrb#GetCommand(a:buffer), \ 'command': ale#fixers#standardrb#GetCommand(a:buffer),
\ 'read_temporary_file': 1, \ 'process_with': 'ale#fixers#rubocop#PostProcess'
\} \}
endfunction endfunction