diff options
| author | Graham Marlow <graham@onesignal.com> | 2023-11-02 09:16:36 -0700 |
|---|---|---|
| committer | Graham Marlow <graham@onesignal.com> | 2023-11-02 09:16:36 -0700 |
| commit | 62c670c19e575a0d7dd723cbd195c18de60bb494 (patch) | |
| tree | 5ad8fe3d0f3afcb9080c9faf85055a3b4a0c781f | |
| parent | 921e8112f85466f6614b4dc82d6aeeb6bdbd2b4f (diff) | |
| download | flymake-clippy-62c670c19e575a0d7dd723cbd195c18de60bb494.tar.gz | |
Add support for custom clippy args
Introduce a new defcustom for providing arguments to the cargo clippy
binary.
Co-authored-by: Jens Östlund <hi@iensu.me>
Co-authored-by: Graham <info@mgmarlow.com>
| -rw-r--r-- | flymake-clippy.el | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/flymake-clippy.el b/flymake-clippy.el index e9dfffc..1cdca7e 100644 --- a/flymake-clippy.el +++ b/flymake-clippy.el @@ -5,7 +5,7 @@ ;; Author: Graham Marlow <info@mgmarlow.com> ;; Keywords: tools ;; URL: https://sr.ht/~mgmarlow/flymake-clippy/ -;; Version: 1.0.1 +;; Version: 1.1.0 ;; Package-Requires: ((emacs "26.1")) ;; This program is free software; you can redistribute it and/or modify @@ -32,6 +32,18 @@ (require 'cl-lib) +(defgroup flymake-clippy nil + "Flymake backend for Clippy." + :group 'programming) + +(defcustom flymake-clippy-bin-args nil + "A list of arguments passed to the `cargo clippy' command. + +For example, a value of `(\"--\" \"-W\" \"clippy::pedantic\")' +results in the command `cargo clippy -- -W clippy::pedantic'." + :type '(repeat string) + :group 'flymake-clippy) + ;; Capture group source example: ;; "warning: ..." ;; --> src/filename.rs @@ -62,6 +74,9 @@ (any "0-9"))) line-end))) +(defun flymake-clippy--bin () + (append (list "cargo" "clippy") flymake-clippy-bin-args)) + (defvar-local flymake-clippy--proc nil "Clippy subprocess object, used to ensure obsolete processes aren't reused.") @@ -84,7 +99,7 @@ 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 (flymake-clippy--bin) :sentinel (lambda (proc _event) (when (memq (process-status proc) '(exit signal)) |
