Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions rust-cargo.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ worksapce for commands like `cargo check`."
:type 'string
:group 'rust-mode)

(defcustom rust-cargo-clippy-default-arguments '()
"Default arguments for running `cargo clippy`."
:type '(repeat string)
:group 'rust-mode)

;;; Buffer Project

(defvar-local rust-buffer-project nil)
Expand Down Expand Up @@ -134,11 +139,13 @@ output buffer will be in comint mode, i.e. interactive."
(interactive)
(when (null rust-buffer-project)
(rust-update-buffer-project))
(let* ((args (list rust-cargo-bin "clippy"
(concat "--manifest-path=" rust-buffer-project)))
(let* ((args (append (list rust-cargo-bin "clippy"
(concat "--manifest-path=" rust-buffer-project))
rust-cargo-clippy-default-arguments))
;; set `compile-command' temporarily so `compile' doesn't
;; clobber the existing value
(compile-command (mapconcat #'shell-quote-argument args " ")))
(compile-command (concat (mapconcat #'shell-quote-argument args " ")
" " rust-cargo-default-arguments)))
(rust--compile nil compile-command)))

;;; _
Expand Down