mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-25 01:38:41 +08:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user