branch: elpa/rust-mode
commit f7334861bfc1d3dbcfbde464751837be2ec09ef3
Merge: 75cc63b6c1 06c48939c5
Author: Sibi Prabakaran <s...@psibi.in>
Commit: GitHub <nore...@github.com>

    Merge pull request #573 from asdfish/master
    
    Add `rust-cargo-clippy-default-arguments`
---
 rust-cargo.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/rust-cargo.el b/rust-cargo.el
index d9f1be5c44..d323b5d239 100644
--- a/rust-cargo.el
+++ b/rust-cargo.el
@@ -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)
@@ -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)))
 
 ;;; _

Reply via email to