[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/package-lint 8eb052b449 1/2: Also handle aliases provided
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/package-lint 8eb052b449 1/2: Also handle aliases provided by compat, like string-split |
Date: |
Mon, 13 Nov 2023 12:59:59 -0500 (EST) |
branch: elpa/package-lint
commit 8eb052b449e4899b3719396ac66f996388821e41
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>
Also handle aliases provided by compat, like string-split
---
package-lint-test.el | 9 ++++++---
package-lint.el | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/package-lint-test.el b/package-lint-test.el
index ca4bb798bb..e50c8135ff 100644
--- a/package-lint-test.el
+++ b/package-lint-test.el
@@ -459,9 +459,11 @@ Alternatively, depend on (emacs \"24.3\") or greater, in
which cl-lib is bundled
(ert-deftest package-lint-test-error-new-compat-functions ()
(should
(equal
- '((6 1 error "You should depend on (emacs \"27.1\") or the compat package
if you need `proper-list-p'."))
+ '((6 1 error "You should depend on (emacs \"27.1\") or the compat package
if you need `proper-list-p'.")
+ (7 1 error "You should depend on (emacs \"29.1\") or the compat package
if you need `string-split'."))
(package-lint-test--run
- "(proper-list-p '(foo))"))))
+ "(proper-list-p '(foo))
+\(string-split s)"))))
(ert-deftest package-lint-test-accepts-new-functions-with-compat ()
(should
@@ -469,7 +471,8 @@ Alternatively, depend on (emacs \"24.3\") or greater, in
which cl-lib is bundled
'()
(package-lint-test--run
";; Package-Requires: ((compat \"29\"))
-\(proper-list-p '(foo))"))))
+\(proper-list-p '(foo))
+\(string-split s)"))))
(ert-deftest package-lint-test-error-new-compat-macros ()
(should
diff --git a/package-lint.el b/package-lint.el
index fc227d7e68..3fbe302fdd 100644
--- a/package-lint.el
+++ b/package-lint.el
@@ -182,7 +182,7 @@ symbol such as `variable-added'.")
(insert-file-contents el-path)
(goto-char (point-min))
(while (search-forward-regexp (rx line-start
- "(compat-" (group (or "defun"
"defmacro" "defvar"))
+ "(compat-" (group (or "defun"
"defmacro" "defvar" "defalias"))
(+ space)
symbol-start
(group (+? any))
@@ -190,7 +190,7 @@ symbol such as `variable-added'.")
nil t)
(pcase (match-string 1)
("defvar" (push (intern (match-string 2)) symbols))
- ((or "defun" "defmacro") (push (intern (match-string 2))
functions)))))))
+ ((or "defun" "defmacro" "defalias") (push (intern (match-string
2)) functions)))))))
(cons symbols functions))
"A cons cell of (VARS . FUNCTIONS) supported by \"compat\".")