mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Close #3285 - lint_file is now dynamic
`lint_file` can now be computed dynamically with a callback function, which can return a deferred result, as per `ale#command#Run`. This allows linters to dynamically switch between checking files on disk, or checking code on the fly. Some tests have been fixed on Windows.
This commit is contained in:
@@ -12,7 +12,7 @@ Before:
|
||||
call ale#linter#Define('foobar', {
|
||||
\ 'name': 'lint_file_linter',
|
||||
\ 'callback': 'LintFileCallback',
|
||||
\ 'executable': 'echo',
|
||||
\ 'executable': has('win32') ? 'cmd' : 'echo',
|
||||
\ 'command': {b -> ale#command#Run(b, 'echo', {-> ale#command#Run(b, 'echo', {-> 'foo'})})},
|
||||
\ 'read_buffer': 0,
|
||||
\})
|
||||
@@ -28,7 +28,7 @@ After:
|
||||
|
||||
Given foobar (Some imaginary filetype):
|
||||
Execute(It should be possible to compute an executable to check based on the result of commands):
|
||||
AssertLinter 'echo', 'foo'
|
||||
AssertLinter has('win32') ? 'cmd' : 'echo', 'foo'
|
||||
|
||||
ALELint
|
||||
call ale#test#FlushJobs()
|
||||
@@ -40,7 +40,7 @@ Execute(It should be possible to compute an executable to check based on the res
|
||||
Execute(It handle the deferred command failing):
|
||||
let g:ale_emulate_job_failure = 1
|
||||
|
||||
AssertLinter 'echo', 0
|
||||
AssertLinter has('win32') ? 'cmd' : 'echo', 0
|
||||
|
||||
ALELint
|
||||
call ale#test#FlushJobs()
|
||||
|
||||
Reference in New Issue
Block a user