summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSibi Prabakaran <sibi@psibi.in>2025-07-05 20:14:45 +0530
committerGitHub <noreply@github.com>2025-07-05 20:14:45 +0530
commitf7334861bfc1d3dbcfbde464751837be2ec09ef3 (patch)
tree0a43d0bd83fe886183d715ce618344697d1ca8e3
parent75cc63b6c19028c11e302c237a8ec64db3345780 (diff)
parent06c48939c56f42235542e4224d68bbdcc0bf1bcf (diff)
downloadrust-mode-f7334861bfc1d3dbcfbde464751837be2ec09ef3.tar.gz
Merge pull request #573 from asdfish/master
Add `rust-cargo-clippy-default-arguments`
-rw-r--r--rust-cargo.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/rust-cargo.el b/rust-cargo.el
index d9f1be5..d323b5d 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)))
;;; _