emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/xr 5c638b3035: Check xr-lint CHECKS argument value for


From: ELPA Syncer
Subject: [elpa] externals/xr 5c638b3035: Check xr-lint CHECKS argument value for validity
Date: Wed, 16 Aug 2023 09:59:22 -0400 (EDT)

branch: externals/xr
commit 5c638b30355fad1ae5d87df66070cadef3bb36d3
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>

    Check xr-lint CHECKS argument value for validity
---
 xr-test.el | 1 +
 xr.el      | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/xr-test.el b/xr-test.el
index 0cb3ae24b5..9d9256f145 100644
--- a/xr-test.el
+++ b/xr-test.el
@@ -478,6 +478,7 @@
     ))
 
 (ert-deftest xr-lint-noisy ()
+  (should-error (xr-lint "." nil 'bad))
   (let ((text-quoting-style 'grave))
     (dolist (checks '(nil all))
       (ert-info ((prin1-to-string checks) :prefix "checks: ")
diff --git a/xr.el b/xr.el
index 80b7a3d0e5..35033fc81b 100644
--- a/xr.el
+++ b/xr.el
@@ -1877,6 +1877,8 @@ including ones more likely to generate false alarms.
 
 Return a list of (OFFSET . COMMENT) where COMMENT applies at OFFSET
 in RE-STRING."
+  (unless (memq checks '(nil all))
+    (error "Bad xr-lint CHECKS argument: %S" checks))
   (let ((warnings (list nil)))
     (xr--parse re-string warnings purpose checks)
     (sort (car warnings) #'car-less-than-car)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]