Skip to content

Add rust-cargo-clippy-default-arguments #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2025
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