branch: externals/relint commit be3979af7f49b770e0548a9c249c5bcc08d5e97a Author: Mattias Engdegård <matti...@acm.org> Commit: Mattias Engdegård <matti...@acm.org>
Check TRIM argument of `split-string' as well --- trawl.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/trawl.el b/trawl.el index 35923b0..5dd3f46 100644 --- a/trawl.el +++ b/trawl.el @@ -499,11 +499,19 @@ (`(,(or `split-string `split-string-and-unquote `string-trim-left `string-trim-right `directory-files-recursively) - ,_ ,re-arg . ,_) + ,_ ,re-arg . ,rest) (unless (and (symbolp re-arg) (memq re-arg trawl--checked-variables)) (trawl--check-re re-arg (format "call to %s" (car form)) - file pos (cons 2 path)))) + file pos (cons 2 path))) + ;; split-string has another regexp argument (trim, arg 4) + (when (and (eq (car form) 'split-string) + (cadr rest)) + (let ((trim (cadr rest))) + (unless (and (symbolp trim) + (memq trim trawl--checked-variables)) + (trawl--check-re trim (format "call to %s" (car form)) + file pos (cons 4 path)))))) (`(,(or `defvar `defconst `defcustom) ,name ,re-arg . ,rest) (when (symbolp name)