Revert "#2132 Change (buffer, lines) fixer functions to (buffer, done, lines)"

This reverts commit f1ed654ca5.
This commit is contained in:
w0rp
2019-02-22 20:48:06 +00:00
parent 883978ece9
commit 89e5491862
9 changed files with 33 additions and 37 deletions

View File

@@ -34,21 +34,21 @@ Before:
call ale#test#SetFilename('test.txt')
call ale#linter#PreventLoading('testft')
function AddCarets(buffer, done, lines) abort
function AddCarets(buffer, lines) abort
" map() is applied to the original lines here.
" This way, we can ensure that defensive copies are made.
return map(a:lines, '''^'' . v:val')
endfunction
function AddDollars(buffer, done, lines) abort
function AddDollars(buffer, lines) abort
return map(a:lines, '''$'' . v:val')
endfunction
function DoNothing(buffer, done, lines) abort
function DoNothing(buffer, lines) abort
return 0
endfunction
function CatLine(buffer, done, lines) abort
function CatLine(buffer, lines) abort
return {'command': 'cat - <(echo d)'}
endfunction
@@ -56,15 +56,15 @@ Before:
return {'command': 'cat - <(echo d)'}
endfunction
function ReplaceWithTempFile(buffer, done, lines) abort
function ReplaceWithTempFile(buffer, lines) abort
return {'command': 'echo x > %t', 'read_temporary_file': 1}
endfunction
function CatWithTempFile(buffer, done, lines) abort
function CatWithTempFile(buffer, lines) abort
return {'command': 'cat %t <(echo d)'}
endfunction
function RemoveLastLine(buffer, done, lines) abort
function RemoveLastLine(buffer, lines) abort
return ['a', 'b']
endfunction
@@ -127,11 +127,11 @@ Before:
endfunction
" echo will output a single blank line, and we should ingore it.
function! IgnoredEmptyOutput(buffer, done, output)
function! IgnoredEmptyOutput(buffer, output)
return {'command': has('win32') ? 'echo(' : 'echo'}
endfunction
function! EchoLineNoPipe(buffer, done, output)
function! EchoLineNoPipe(buffer, output)
return {'command': 'echo new line', 'read_buffer': 0}
endfunction
@@ -438,7 +438,7 @@ Execute(ALEFix should accept lambdas):
" to make the test pass.
call setline(1, ['a', 'b', 'c', 'd'])
else
let g:ale_fixers.testft = [{buffer, done, lines -> lines + ['d']}]
let g:ale_fixers.testft = [{buffer, lines -> lines + ['d']}]
ALEFix
call ale#test#FlushJobs()
endif

View File

@@ -16,7 +16,7 @@ Execute(Long lines with basic function calls should be broken up correctly):
\ ' bar,',
\ '))',
\ ],
\ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), v:null, [
\ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), [
\ 'def foo():',
\ ' some_variable = this_is_a_longer_function(first_argument, second_argument, third_with_function_call(foo, bar))',
\ ])
@@ -33,7 +33,7 @@ Execute(Longer lines should be permitted if a configuration file allows it):
\ ' a_third_long_word,',
\ ')'
\ ],
\ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), v:null, [
\ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), [
\ 'x = this_line_is_between_79_and_90_characters(first, second, third, fourth, fifth)',
\ 'y = this_line_is_longer_than_90_characters(much_longer_word, another_longer_word, a_third_long_word)',
\ ])

View File

@@ -16,13 +16,13 @@ Execute(Should delete all whitespace at the end of different lines):
\ ' bar,',
\ '))',
\ ],
\ ale#fixers#generic#TrimWhitespace(bufnr(''), v:null, [
\ 'def foo():',
\ ' some_variable = this_is_a_longer_function(',
\ 'first_argument,',
\ ' second_argument,',
\ ' third_with_function_call(',
\ 'foo,',
\ ' bar,',
\ '))',
\ ale#fixers#generic#TrimWhitespace(bufnr(''), [
\ 'def foo():',
\ ' some_variable = this_is_a_longer_function(',
\ 'first_argument,',
\ ' second_argument,',
\ ' third_with_function_call(',
\ 'foo,',
\ ' bar,',
\ '))',
\ ])

View File

@@ -23,7 +23,7 @@ Before:
return [{'lnum': 1, 'col': 1, 'text': 'xxx'}]
endfunction
function AddLine(buffer, done, lines) abort
function AddLine(buffer, lines) abort
return a:lines + ['x']
endfunction