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

View File

@@ -118,20 +118,23 @@ Execute(--all-features should be used when g:ale_rust_cargo_default_feature_beha
GivenCommandOutput ['cargo 0.22.0 (3423351a5 2017-10-06)']
AssertLinter 'cargo', [ale#Escape('cargo') . ' --version', 'cargo check --frozen --message-format=json -q --all-features']
Execute(When a crate belongs to a workspace we should cd into the crate):
Execute(Cargo should run from the crate directory when set to avoid the workspace):
let g:ale_rust_cargo_avoid_whole_workspace = 1
call ale#test#SetFilename('cargo_workspace_paths/subpath/test.rs')
AssertLinterCwd ale#path#Simplify(g:dir . '/cargo_workspace_paths/subpath')
call ale#semver#ResetVersionCache()
AssertLinter 'cargo', [
\ ale#Escape('cargo') . ' --version',
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/cargo_workspace_paths/subpath')) . ' && '
\ . 'cargo check --frozen --message-format=json -q',
\ 'cargo check --frozen --message-format=json -q',
\]
Execute(When a crate belongs to a workspace we chdir into the crate, unless we disabled it):
Execute(Cargo should not run from the crate directory when not set to avoid the workspace):
let g:ale_rust_cargo_avoid_whole_workspace = 0
call ale#test#SetFilename('cargo_workspace_paths/subpath/test.rs')
AssertLinterCwd ''
call ale#semver#ResetVersionCache()
AssertLinter 'cargo', [
\ ale#Escape('cargo') . ' --version',
\ 'cargo check --frozen --message-format=json -q',