Close #2281 - Separate cwd commands from commands

Working directories are now set seperately from the commands so they
can later be swapped out when running linters over projects is
supported, and also better support filename mapping for running linters
on other machines in future.
This commit is contained in:
w0rp
2021-03-01 20:11:10 +00:00
parent 48fab99a0a
commit 9fe7b1fe6a
117 changed files with 1142 additions and 1111 deletions
+29 -1
View File
@@ -89,6 +89,34 @@ Execute (PreProcess should allow command to be a callback):
\ 'command': function('type'),
\})
Execute (PreProcess should throw when cwd is not a string):
AssertThrows call ale#linter#PreProcess('testft', {
\ 'name': 'foo',
\ 'callback': 'SomeFunction',
\ 'executable': 'echo',
\ 'cwd': [],
\ 'command': 'echo',
\})
AssertEqual '`cwd` must be a String or Function if defined', g:vader_exception
Execute (PreProcess should allow cwd to be a callback):
call ale#linter#PreProcess('testft', {
\ 'name': 'foo',
\ 'callback': 'SomeFunction',
\ 'executable': 'echo',
\ 'cwd': function('type'),
\ 'command': 'echo',
\})
Execute (PreProcess should allow cwd to be a string):
call ale#linter#PreProcess('testft', {
\ 'name': 'foo',
\ 'callback': 'SomeFunction',
\ 'executable': 'echo',
\ 'cwd': '/foo/bar',
\ 'command': 'echo',
\})
Execute (PreProcess should when the output stream isn't a valid string):
AssertThrows call ale#linter#PreProcess('testft', {
\ 'name': 'foo',
@@ -305,7 +333,7 @@ Execute(PreProcess should complain about invalid language values):
\}
AssertThrows call ale#linter#PreProcess('testft', g:linter)
AssertEqual '`language` must be a String or Funcref if defined', g:vader_exception
AssertEqual '`language` must be a String or Function if defined', g:vader_exception
Execute(PreProcess should use the filetype as the language string by default):
let g:linter = {