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

[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))



reply via email to

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