#333 Add the List needed for the lint_file option, and option itself. Neither do anything meaningful yet
This commit is contained in:
@@ -28,6 +28,8 @@ function! ale#engine#InitBufferInfo(buffer) abort
|
||||
if !has_key(g:ale_buffer_info, a:buffer)
|
||||
" job_list will hold the list of jobs
|
||||
" loclist holds the loclist items after all jobs have completed.
|
||||
" lint_file_loclist holds items from the last run including linters
|
||||
" which use the lint_file option.
|
||||
" new_loclist holds loclist items while jobs are being run.
|
||||
" temporary_file_list holds temporary files to be cleaned up
|
||||
" temporary_directory_list holds temporary directories to be cleaned up
|
||||
@@ -35,6 +37,7 @@ function! ale#engine#InitBufferInfo(buffer) abort
|
||||
let g:ale_buffer_info[a:buffer] = {
|
||||
\ 'job_list': [],
|
||||
\ 'loclist': [],
|
||||
\ 'lint_file_loclist': [],
|
||||
\ 'new_loclist': [],
|
||||
\ 'temporary_file_list': [],
|
||||
\ 'temporary_directory_list': [],
|
||||
|
||||
@@ -142,13 +142,25 @@ function! ale#linter#PreProcess(linter) abort
|
||||
throw "`output_stream` must be 'stdout', 'stderr', or 'both'"
|
||||
endif
|
||||
|
||||
" An option indicating that this linter should only be run against the
|
||||
" file on disk.
|
||||
let l:obj.lint_file = get(a:linter, 'lint_file', 0)
|
||||
|
||||
if !s:IsBoolean(l:obj.lint_file)
|
||||
throw '`lint_file` must be `0` or `1`'
|
||||
endif
|
||||
|
||||
" An option indicating that the buffer should be read.
|
||||
let l:obj.read_buffer = get(a:linter, 'read_buffer', 1)
|
||||
let l:obj.read_buffer = get(a:linter, 'read_buffer', !l:obj.lint_file)
|
||||
|
||||
if !s:IsBoolean(l:obj.read_buffer)
|
||||
throw '`read_buffer` must be `0` or `1`'
|
||||
endif
|
||||
|
||||
if l:obj.lint_file && l:obj.read_buffer
|
||||
throw 'Only one of `lint_file` or `read_buffer` can be `1`'
|
||||
endif
|
||||
|
||||
return l:obj
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user