~mgmarlow/public-inbox

flymake-clippy: Allow passing arguments to the clippy command v1 PROPOSED

Jens Östlund: 1
 Allow passing arguments to the clippy command

 1 files changed, 7 insertions(+), 1 deletions(-)
Graham Marlow <graham@mgmarlow.com> writes:
That's true!
Yes, that sounds like a cleaner way to go about it. Do you want me to make any changes to this patch? When you extract the command to a function argument support comes for free so there'll be no need for it.
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~mgmarlow/public-inbox/patches/46304/mbox | git am -3
Learn more about email & git

[PATCH flymake-clippy] Allow passing arguments to the clippy command Export this patch

---
Hi! I added a variable to be able to pass arguments to the clippy command and I thought it might be useful for others as well :)
 flymake-clippy.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/flymake-clippy.el b/flymake-clippy.el
index e9dfffc..1599896 100644
--- a/flymake-clippy.el
+++ b/flymake-clippy.el
@@ -65,6 +65,11 @@
(defvar-local flymake-clippy--proc nil
  "Clippy subprocess object, used to ensure obsolete processes aren't reused.")

(defvar flymake-clippy-clippy-args nil
  "A list of arguments to be passed to the `cargo clippy' command.

For example, a value of `(\"-W\" \"clippy::pedantic\")' will result in the command `cargo clippy -- -W clippy::pedantic'.")

(defun flymake-clippy-backend (report-fn &rest _args)
  "Flymake backend for Clippy, the Rust linter.

@@ -84,7 +89,8 @@ with the appropriate Flymake hook."
            (make-process
             :name "flymake-clippy" :noquery t :connection-type 'pipe
             :buffer (generate-new-buffer "*flymake-clippy*")
             :command '("cargo" "clippy")
             :command '("cargo" "clippy" ,@(when flymake-clippy-clippy-args
                                             (cons "--" flymake-clippy-clippy-args)))
             :sentinel
             (lambda (proc _event)
               (when (memq (process-status proc) '(exit signal))
--
2.42.0