Skip to content

Commit f733486

Browse files
authored
Merge pull request #573 from asdfish/master
Add `rust-cargo-clippy-default-arguments`
2 parents 75cc63b + 06c4893 commit f733486

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

rust-cargo.el

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ worksapce for commands like `cargo check`."
3131
:type 'string
3232
:group 'rust-mode)
3333

34+
(defcustom rust-cargo-clippy-default-arguments '()
35+
"Default arguments for running `cargo clippy`."
36+
:type '(repeat string)
37+
:group 'rust-mode)
38+
3439
;;; Buffer Project
3540

3641
(defvar-local rust-buffer-project nil)
@@ -134,11 +139,13 @@ output buffer will be in comint mode, i.e. interactive."
134139
(interactive)
135140
(when (null rust-buffer-project)
136141
(rust-update-buffer-project))
137-
(let* ((args (list rust-cargo-bin "clippy"
138-
(concat "--manifest-path=" rust-buffer-project)))
142+
(let* ((args (append (list rust-cargo-bin "clippy"
143+
(concat "--manifest-path=" rust-buffer-project))
144+
rust-cargo-clippy-default-arguments))
139145
;; set `compile-command' temporarily so `compile' doesn't
140146
;; clobber the existing value
141-
(compile-command (mapconcat #'shell-quote-argument args " ")))
147+
(compile-command (concat (mapconcat #'shell-quote-argument args " ")
148+
" " rust-cargo-default-arguments)))
142149
(rust--compile nil compile-command)))
143150

144151
;;; _

0 commit comments

Comments
 (0)