#1524 Do not try to check buffers with empty filetypes
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
Before:
|
||||
Save g:ale_set_signs
|
||||
Save g:ale_buffer_info
|
||||
|
||||
let g:ale_set_signs = 1
|
||||
let g:ale_buffer_info = {}
|
||||
|
||||
call ale#linter#Reset()
|
||||
sign unplace *
|
||||
|
||||
@@ -14,6 +14,7 @@ After:
|
||||
catch
|
||||
endtry
|
||||
|
||||
Given foobar(An empty file):
|
||||
Execute(Run a lint cycle, and check that a variable is set in the autocmd):
|
||||
augroup VaderTest
|
||||
autocmd!
|
||||
|
||||
@@ -13,6 +13,7 @@ After:
|
||||
call ale#linter#Reset()
|
||||
call ale#engine#ClearLSPData()
|
||||
|
||||
Given foobar(An empty file):
|
||||
Execute(tsserver syntax error responses should be handled correctly):
|
||||
runtime ale_linters/typescript/tsserver.vim
|
||||
call ale#test#SetFilename('filename.ts')
|
||||
|
||||
@@ -11,6 +11,7 @@ After:
|
||||
|
||||
call ale#ResetErrorDelays()
|
||||
|
||||
Given foobar(An empty file):
|
||||
Execute(ALE should stop queuing for a while after exceptions are thrown):
|
||||
AssertThrows call ale#Queue(100)
|
||||
call ale#Queue(100)
|
||||
|
||||
@@ -26,6 +26,7 @@ After:
|
||||
|
||||
unlet! b:funky_command_created
|
||||
|
||||
Given foobar(An empty file):
|
||||
Execute(ALE shouldn't do much of anything for ctrlp-funky buffers):
|
||||
Assert !ale#ShouldDoNothing(bufnr('')), 'The preliminary check failed'
|
||||
|
||||
@@ -43,6 +44,16 @@ Execute(ALE shouldn't try to check buffers with '.' as the filename):
|
||||
|
||||
Assert ale#ShouldDoNothing(bufnr(''))
|
||||
|
||||
Execute(DoNothing should return 0 when the filetype is empty):
|
||||
AssertEqual
|
||||
\ 0,
|
||||
\ ale#ShouldDoNothing(bufnr('')),
|
||||
\ 'ShouldDoNothing() was 1 for some other reason'
|
||||
|
||||
set filetype=
|
||||
|
||||
AssertEqual 1, ale#ShouldDoNothing(bufnr(''))
|
||||
|
||||
Execute(The DoNothing check should work if the ALE globals aren't defined):
|
||||
unlet! g:ale_filetype_blacklist
|
||||
unlet! g:ale_maximum_file_size
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
Before:
|
||||
Save g:ale_buffer_info
|
||||
|
||||
let g:ale_buffer_info = {}
|
||||
let g:ale_run_synchronously = 1
|
||||
|
||||
let g:command = 'echo test'
|
||||
@@ -41,6 +44,8 @@ Before:
|
||||
\})
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
if !empty(g:preserved_directory)
|
||||
call delete(g:preserved_directory, 'rf')
|
||||
endif
|
||||
@@ -111,3 +116,17 @@ Execute(ALE should create and delete directories for ale#engine#CreateDirectory(
|
||||
|
||||
Assert !isdirectory(b:dir), 'The directory was not deleted'
|
||||
Assert !isdirectory(b:dir2), 'The second directory was not deleted'
|
||||
|
||||
Execute(ale#engine#ManageFile should add the file even if the buffer info hasn't be set yet):
|
||||
let g:ale_buffer_info = {}
|
||||
call ale#engine#ManageFile(bufnr(''), '/foo/bar')
|
||||
AssertEqual
|
||||
\ ['/foo/bar'],
|
||||
\ g:ale_buffer_info[bufnr('')].temporary_file_list
|
||||
|
||||
Execute(ale#engine#ManageDirectory should add the directory even if the buffer info hasn't be set yet):
|
||||
let g:ale_buffer_info = {}
|
||||
call ale#engine#ManageDirectory(bufnr(''), '/foo/bar')
|
||||
AssertEqual
|
||||
\ ['/foo/bar'],
|
||||
\ g:ale_buffer_info[bufnr('')].temporary_directory_list
|
||||
|
||||
@@ -22,4 +22,3 @@ Execute(Set Verilog Verilator linter additional options to `-sv --default-langua
|
||||
\ g:matched ,
|
||||
\ -1 ,
|
||||
\ 'Additionnal arguments not found in the run command'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user