Add new fixer: TrimWhitespace (#991)

add a new fixer: trim_whitespace
This commit is contained in:
Carlos Ramos
2017-10-12 04:27:24 -04:00
committed by w0rp
parent 02c8793c53
commit 844354cfed
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
Before:
call ale#test#SetDirectory('/testplugin/test/fixers')
After:
call ale#test#RestoreDirectory()
Execute(Should delete all whitespace at the end of different lines):
AssertEqual
\ [
\ '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,',
\ '))',
\ ])