diff options
author | Jean Mertz <jean@mertz.fm> | 2019-06-24 19:55:49 +0200 |
---|---|---|
committer | Jean Mertz <jean@mertz.fm> | 2019-06-25 11:22:36 +0200 |
commit | 53b0e6c37dc8c377a09f97b8aa20e283b1aa305d (patch) | |
tree | b4e36653e0a725911738efa78f8b6096c11e53c3 /test/command_callback/test_cargo_command_callbacks.vader | |
parent | e52388b8b1361198a6d2668a1fcaa4b78729187f (diff) | |
download | ale-53b0e6c37dc8c377a09f97b8aa20e283b1aa305d.zip |
support all cargo options for build/clippy
Diffstat (limited to 'test/command_callback/test_cargo_command_callbacks.vader')
-rw-r--r-- | test/command_callback/test_cargo_command_callbacks.vader | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/test/command_callback/test_cargo_command_callbacks.vader b/test/command_callback/test_cargo_command_callbacks.vader index 42ca0301..e56551ae 100644 --- a/test/command_callback/test_cargo_command_callbacks.vader +++ b/test/command_callback/test_cargo_command_callbacks.vader @@ -139,6 +139,7 @@ Execute(When a crate belongs to a workspace we chdir into the crate, unless we d Execute(When ale_rust_cargo_use_clippy is set, cargo-clippy is used as linter): let b:ale_rust_cargo_use_clippy = 1 + AssertLinter 'cargo', [ \ ale#Escape('cargo') . ' --version', \ 'cargo clippy --frozen --message-format=json -q', @@ -147,23 +148,51 @@ Execute(When ale_rust_cargo_use_clippy is set, cargo-clippy is used as linter): Execute(When ale_rust_cargo_clippy_options is set, cargo-clippy appends it to commandline): let b:ale_rust_cargo_use_clippy = 1 let b:ale_rust_cargo_clippy_options = '-- -D warnings' + AssertLinter 'cargo', [ \ ale#Escape('cargo') . ' --version', \ 'cargo clippy --frozen --message-format=json -q -- -D warnings', \] -Execute(When ale_rust_cargo_clippy_options does not start with --, it is added): +Execute(Clippy options work without prepending --): let b:ale_rust_cargo_use_clippy = 1 let b:ale_rust_cargo_clippy_options = '-D warnings' + AssertLinter 'cargo', [ \ ale#Escape('cargo') . ' --version', \ 'cargo clippy --frozen --message-format=json -q -- -D warnings', \] +Execute(Build supports all cargo flags): + let g:ale_rust_cargo_use_check = 0 + let g:ale_rust_cargo_check_all_targets = 1 + let g:ale_rust_cargo_check_tests = 1 + let g:ale_rust_cargo_check_examples = 1 + let b:ale_rust_cargo_default_feature_behavior = 'all' + + AssertLinter 'cargo', [ + \ ale#Escape('cargo') . ' --version', + \ 'cargo build --all-targets --examples --tests --frozen --message-format=json -q --all-features', + \] + +Execute(Clippy supports all cargo flags): + let b:ale_rust_cargo_use_clippy = 1 + let g:ale_rust_cargo_check_all_targets = 1 + let g:ale_rust_cargo_check_tests = 1 + let g:ale_rust_cargo_check_examples = 1 + let b:ale_rust_cargo_default_feature_behavior = 'all' + let b:ale_rust_cargo_clippy_options = '-D warnings' + + AssertLinter 'cargo', [ + \ ale#Escape('cargo') . ' --version', + \ 'cargo clippy --all-targets --examples --tests --frozen --message-format=json -q --all-features -- -D warnings', + \] + Execute(cargo-check does not refer ale_rust_cargo_clippy_options): let b:ale_rust_cargo_use_clippy = 0 let b:ale_rust_cargo_use_check = 1 let b:ale_rust_cargo_clippy_options = '-- -D warnings' + AssertLinter 'cargo', [ \ ale#Escape('cargo') . ' --version', \ 'cargo check --frozen --message-format=json -q', |