[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 1ec2d8b 02/23: More elaborate parsing of doc str
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint 1ec2d8b 02/23: More elaborate parsing of doc strings of global variables |
Date: |
Sun, 29 Sep 2019 15:34:50 -0400 (EDT) |
branch: externals/relint
commit 1ec2d8b17905dfa4ad9eb8729c0be18d8c17bbe0
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
More elaborate parsing of doc strings of global variables
Now detects "When non-nil, specifies a regexp ..."
---
relint.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/relint.el b/relint.el
index 66fd0a2..40537b7 100644
--- a/relint.el
+++ b/relint.el
@@ -1302,10 +1302,22 @@ return (NAME); on syntax error, return nil."
(symbol-name name))
(relint--check-rules-list re-arg name file pos (cons 2 path))
(push name relint--checked-variables))
- ;; Doc string starting with "regexp"?
+ ;; Doc string starting with "regexp" etc.
((and (stringp (car rest))
(let ((case-fold-search t))
- (string-match-p (rx bos "regexp") (car rest))))
+ (string-match-p
+ (rx bos
+ (opt (or "when" "if")
+ (* " ")
+ (or "not" "non")
+ (* (any "- "))
+ "nil"
+ (* (any " ,")))
+ (opt (or "specify" "specifies")
+ " ")
+ (opt (or "a" "the" "this") " ")
+ (or "regex" "regular expression"))
+ (car rest))))
(relint--check-re re-arg name file pos (cons 2 path))
(when (eq (car form) 'defcustom)
(relint--check-defcustom-re form name file pos path))
- [elpa] externals/relint updated (0bf6883 -> b0f0bee), Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 099b59f 01/23: Reorder strings in regexp for more efficient matching, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 1ec2d8b 02/23: More elaborate parsing of doc strings of global variables,
Mattias Engdegård <=
- [elpa] externals/relint 95b3c07 08/23: Add `xor' and bitwise operations to the list of safe functions, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 3f3408d 07/23: Check both car and cdr of items in -regexp-alist variables, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 5142c86 09/23: Fix function evaluation bug, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 43c4644 06/23: Correct naming, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint e11b871 12/23: More robust scanning of format strings for mixup check, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 956a15b 17/23: Fix defun parsing, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 3a27cff 18/23: Handle mutation of local variables in evaluation, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint d2b7194 19/23: Evaluate `dolist' and `while', Mattias Engdegård, 2019/09/29
- [elpa] externals/relint b2a86b8 04/23: Fix typo in message description and clarify, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 1cb021a 03/23: Remove relint--eval-error, Mattias Engdegård, 2019/09/29