Fix #1176 - Add an option for caching failing executable checks

This commit is contained in:
w0rp 2017-11-30 10:34:51 +00:00
parent fd261264d7
commit a990188e27
4 changed files with 57 additions and 7 deletions

View file

@ -2,9 +2,13 @@ Before:
Save g:ale_warn_about_trailing_whitespace
Save g:ale_linters
Save g:ale_fixers
Save g:ale_lint_on_text_changed
Save g:ale_cache_executable_check_failures
unlet! b:ale_history
let g:ale_lint_on_text_changed = 'always'
let g:ale_cache_executable_check_failures = 0
let g:ale_warn_about_trailing_whitespace = 1
let g:testlinter1 = {'name': 'testlinter1', 'executable': 'testlinter1', 'command': 'testlinter1', 'callback': 'testCB1', 'output_stream': 'stdout'}
@ -355,6 +359,31 @@ Execute (ALEInfo command history should print command output if logging is on):
Execute (ALEInfo should include executable checks in the history):
call ale#linter#Define('testft', g:testlinter1)
call ale#engine#IsExecutable(bufnr(''), has('win32') ? 'cmd' : 'echo')
call ale#engine#IsExecutable(bufnr(''), has('win32') ? 'cmd' : 'echo')
call ale#engine#IsExecutable(bufnr(''), 'TheresNoWayThisIsExecutable')
call ale#engine#IsExecutable(bufnr(''), 'TheresNoWayThisIsExecutable')
call CheckInfo([
\ ' Current Filetype: testft.testft2',
\ 'Available Linters: [''testlinter1'']',
\ ' Enabled Linters: [''testlinter1'']',
\ ' Linter Variables:',
\ '',
\] + g:globals_lines + g:command_header + [
\ '',
\ '(executable check - success) ' . (has('win32') ? 'cmd' : 'echo'),
\ '(executable check - failure) TheresNoWayThisIsExecutable',
\ '(executable check - failure) TheresNoWayThisIsExecutable',
\])
Execute (The option for caching failing executable checks should work):
let g:ale_cache_executable_check_failures = 1
call ale#linter#Define('testft', g:testlinter1)
call ale#engine#IsExecutable(bufnr(''), has('win32') ? 'cmd' : 'echo')
call ale#engine#IsExecutable(bufnr(''), has('win32') ? 'cmd' : 'echo')
call ale#engine#IsExecutable(bufnr(''), 'TheresNoWayThisIsExecutable')
call ale#engine#IsExecutable(bufnr(''), 'TheresNoWayThisIsExecutable')
call CheckInfo([