mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-17 13:59:47 +08:00
#2132 - lint and fix with ale#command#Run
A new function is added here which will later be modified for public use in linter and fixer callbacks. All linting and fixing now goes through this new function, to prove that it works in all cases.
This commit is contained in:
@@ -58,6 +58,7 @@ Execute(No linting should be done on :wq or :x):
|
||||
|
||||
" First try just the SaveEvent, to be sure that we set errors in the test.
|
||||
call ale#events#SaveEvent(bufnr(''))
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
AssertEqual 1, len(ale#test#GetLoclistWithoutModule())
|
||||
|
||||
@@ -65,6 +66,7 @@ Execute(No linting should be done on :wq or :x):
|
||||
call setloclist(0, [])
|
||||
call ale#events#QuitEvent(bufnr(''))
|
||||
call ale#events#SaveEvent(bufnr(''))
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
AssertEqual [], ale#test#GetLoclistWithoutModule()
|
||||
|
||||
@@ -73,11 +75,13 @@ Execute(No linting should be for :w after :q fails):
|
||||
let g:ale_fix_on_save = 0
|
||||
|
||||
call ale#events#QuitEvent(bufnr(''))
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
" Simulate 2 seconds passing.
|
||||
let b:ale_quitting -= 1000
|
||||
|
||||
call ale#events#SaveEvent(bufnr(''))
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
AssertEqual 1, len(ale#test#GetLoclistWithoutModule())
|
||||
|
||||
@@ -86,6 +90,7 @@ Execute(No linting should be done on :wq or :x after fixing files):
|
||||
let g:ale_fix_on_save = 1
|
||||
|
||||
call ale#events#SaveEvent(bufnr(''))
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
AssertEqual 1, len(ale#test#GetLoclistWithoutModule())
|
||||
|
||||
@@ -93,6 +98,7 @@ Execute(No linting should be done on :wq or :x after fixing files):
|
||||
call setloclist(0, [])
|
||||
call ale#events#QuitEvent(bufnr(''))
|
||||
call ale#events#SaveEvent(bufnr(''))
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
AssertEqual [], ale#test#GetLoclistWithoutModule()
|
||||
|
||||
@@ -101,10 +107,12 @@ Execute(Linting should be done after :q fails and fixing files):
|
||||
let g:ale_fix_on_save = 1
|
||||
|
||||
call ale#events#QuitEvent(bufnr(''))
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
" Simulate 2 seconds passing.
|
||||
let b:ale_quitting -= 1000
|
||||
|
||||
call ale#events#SaveEvent(bufnr(''))
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
AssertEqual 1, len(ale#test#GetLoclistWithoutModule())
|
||||
|
||||
Reference in New Issue
Block a user