[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/reformatter dc6278a6b1 49/81: Merge pull request #23 from
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/reformatter dc6278a6b1 49/81: Merge pull request #23 from purcell/non-zero-exit |
Date: |
Tue, 5 Sep 2023 04:03:37 -0400 (EDT) |
branch: elpa/reformatter
commit dc6278a6b1e3565604346ac41a6ffc3cbab04031
Merge: 8423ad9e83 7219a0804c
Author: Steve Purcell <steve@sanityinc.com>
Commit: GitHub <noreply@github.com>
Merge pull request #23 from purcell/non-zero-exit
Support for formatters which succeed with non-zero exit codes
---
reformatter.el | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/reformatter.el b/reformatter.el
index 1262fcd695..8c1df62b93 100644
--- a/reformatter.el
+++ b/reformatter.el
@@ -75,7 +75,7 @@
(require 'ansi-color)
;;;###autoload
-(cl-defmacro reformatter-define (name &key program args (mode t) lighter
keymap group)
+(cl-defmacro reformatter-define (name &key program args (mode t) lighter
keymap group (exit-code-success-p 'zerop))
"Define a reformatter command with NAME.
When called, the reformatter will use PROGRAM and any ARGS to
@@ -121,9 +121,18 @@ The macro accepts the following keyword arguments:
:keymap
If provided, this is the symbol name of the \"-on-save\" mode's
- keymap, which you must declare yourself. Default is no keymap."
+ keymap, which you must declare yourself. Default is no keymap.
+
+:exit-code-success-p
+
+ If provided, this is a function object callable with `funcall'
+ which accepts an integer process exit code, and returns non-nil
+ if that exit code is considered successful. This could be a
+ lambda, quoted symbol or sharp-quoted symbol. If not supplied,
+ the code is considered successful if it is `zerop'."
(declare (indent defun))
(cl-assert (symbolp name))
+ (cl-assert (functionp exit-code-success-p))
(cl-assert program)
;; Note: we skip using `gensym' here because the macro arguments are only
;; referred to once below, but this may have to change later.
@@ -182,7 +191,7 @@ DISPLAY-ERRORS, shows a buffer if the formatting fails."
(insert-file-contents err-file nil nil nil t)
(ansi-color-apply-on-region (point-min) (point-max)))
(special-mode))
- (if (zerop retcode)
+ (if (funcall #',exit-code-success-p retcode)
(progn
(save-restriction
;; This replacement method minimises
- [nongnu] elpa/reformatter 6484d45a87 07/81: Only support string mode lighters, (continued)
- [nongnu] elpa/reformatter 6484d45a87 07/81: Only support string mode lighters, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 123d192fb0 16/81: Use https for sanityinc.com link, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 2b2785557a 15/81: Clearer documentation, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter b2963f5100 23/81: Narrow to region when replacing contents with reformatter output, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 78eb8bc98a 09/81: Doc clarifications, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 0da7241ca2 34/81: Actually check for broken replace-buffer-contents, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 2fd158102f 54/81: Merge pull request #27 from purcell/files-in-place, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 6c5e7f64c5 41/81: Never use `replace-buffer-contents', ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 7219a0804c 48/81: Support for formatters which succeed with non-zero exit codes, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 00413b21ec 28/81: Add reminder to use a `defgroup` form, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter dc6278a6b1 49/81: Merge pull request #23 from purcell/non-zero-exit,
ELPA Syncer <=
- [nongnu] elpa/reformatter c9450a39c3 32/81: Merge pull request #8 from wbolster/patch-1, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 48605c92a7 42/81: Add CI, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter e15598a0cc 40/81: Prefer `delete-trailing-whitespace` to the aggressive `whitespace-cleanup`, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 1bf00b2aa3 43/81: Add FUNDING.yml, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 16a7b32736 25/81: Prefer zerop to (eq 0 ...), ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter ac980a8797 27/81: Fix typo in comment, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter aeef16ff67 53/81: Support formatters that operate on files in place, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 27348d5da3 31/81: Use string as modeline lighter format in README, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 897f3ba503 67/81: Handle slashes in names of created functions, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 45c0add950 57/81: Move conditional input file path to compile time, ELPA Syncer, 2023/09/05