summaryrefslogtreecommitdiff
path: root/ale_linters/rust/cargo.vim
diff options
context:
space:
mode:
authorJean Mertz <jean@mertz.fm>2019-06-24 19:47:49 +0200
committerJean Mertz <jean@mertz.fm>2019-06-24 19:47:49 +0200
commite52388b8b1361198a6d2668a1fcaa4b78729187f (patch)
treed544bc43bffbe45fa118359c611bfc3e9673c788 /ale_linters/rust/cargo.vim
parent65ba4b85ec3011cccb9ea7135183e7fc8d7a0d69 (diff)
downloadale-e52388b8b1361198a6d2668a1fcaa4b78729187f.zip
support clippy options with --
Diffstat (limited to 'ale_linters/rust/cargo.vim')
-rw-r--r--ale_linters/rust/cargo.vim10
1 files changed, 9 insertions, 1 deletions
diff --git a/ale_linters/rust/cargo.vim b/ale_linters/rust/cargo.vim
index f98dee9b..8ea6f19c 100644
--- a/ale_linters/rust/cargo.vim
+++ b/ale_linters/rust/cargo.vim
@@ -69,7 +69,15 @@ function! ale_linters#rust#cargo#GetCommand(buffer, version) abort
if ale#Var(a:buffer, 'rust_cargo_use_clippy')
let l:subcommand = 'clippy'
- let l:clippy_options = ' ' . ale#Var(a:buffer, 'rust_cargo_clippy_options')
+
+ let l:clippy_options = ale#Var(a:buffer, 'rust_cargo_clippy_options')
+ if l:clippy_options =~ "^-- "
+ let l:clippy_options = join(split(l:clippy_options, '-- '))
+ endif
+
+ if l:clippy_options isnot# ''
+ let l:clippy_options = ' -- ' . l:clippy_options
+ endif
endif
return l:nearest_cargo_prefix . 'cargo '