[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 326cfe2 11/21: Check calls to directory-files(-a
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint 326cfe2 11/21: Check calls to directory-files(-and-attributes) |
Date: |
Sun, 3 May 2020 11:13:37 -0400 (EDT) |
branch: externals/relint
commit 326cfe24cd110e4cf7686b4a154c7bdb55a727e8
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Check calls to directory-files(-and-attributes)
---
relint.el | 4 ++++
test/2.elisp | 5 ++++-
test/2.expected | 49 +++++++++++++++++++++++++++++--------------------
3 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/relint.el b/relint.el
index b17d451..6c81221 100644
--- a/relint.el
+++ b/relint.el
@@ -1844,6 +1844,10 @@ directly."
(memq trim relint--checked-variables))
(relint--check-re trim (format "call to %s" (car form))
file pos (cons 4 path))))))
+ (`(,(or 'directory-files 'directory-files-and-attributes)
+ ,_ ,_ ,re-arg . ,_)
+ (relint--check-re re-arg (format "call to %s" (car form))
+ file pos (cons 3 path)))
(`(,(or 'skip-chars-forward 'skip-chars-backward)
,skip-arg . ,_)
(let ((str (relint--get-string skip-arg)))
diff --git a/test/2.elisp b/test/2.elisp
index a96cef0..f069a33 100644
--- a/test/2.elisp
+++ b/test/2.elisp
@@ -26,7 +26,10 @@
(split-string-and-unquote s "[vv]")
(string-trim-left s "[ww]")
(string-trim-right s "[xx]")
- (string-trim s "[yy]" "[zz]"))
+ (string-trim s "[yy]" "[zz]")
+ (directory-files s nil "+1")
+ (directory-files-and-attributes s nil "+2")
+ (directory-files-recursively s "+3"))
;; Test argument names as means of detecting regexps.
(defun f2 (x1 my-regexp x2 my-regex x3 my-re x4 my-pattern x5 re)
diff --git a/test/2.expected b/test/2.expected
index 0dbcfc8..347f31d 100644
--- a/test/2.expected
+++ b/test/2.expected
@@ -79,63 +79,72 @@
2.elisp:29:28: In call to string-trim: Duplicated `z' inside character
alternative (pos 2)
"[zz]"
..^
-2.elisp:42:17: In call to f2: Duplicated `B' inside character alternative (pos
2)
+2.elisp:30:27: In call to directory-files: Unescaped literal `+' (pos 0)
+ "+1"
+ ^
+2.elisp:31:42: In call to directory-files-and-attributes: Unescaped literal
`+' (pos 0)
+ "+2"
+ ^
+2.elisp:32:35: In call to directory-files-recursively: Unescaped literal `+'
(pos 0)
+ "+3"
+ ^
+2.elisp:45:17: In call to f2: Duplicated `B' inside character alternative (pos
2)
"[BB]"
..^
-2.elisp:42:31: In call to f2: Duplicated `D' inside character alternative (pos
2)
+2.elisp:45:31: In call to f2: Duplicated `D' inside character alternative (pos
2)
"[DD]"
..^
-2.elisp:42:45: In call to f2: Duplicated `F' inside character alternative (pos
2)
+2.elisp:45:45: In call to f2: Duplicated `F' inside character alternative (pos
2)
"[FF]"
..^
-2.elisp:42:59: In call to f2: Duplicated `H' inside character alternative (pos
2)
+2.elisp:45:59: In call to f2: Duplicated `H' inside character alternative (pos
2)
"[HH]"
..^
-2.elisp:42:73: In call to f2: Duplicated `J' inside character alternative (pos
2)
+2.elisp:45:73: In call to f2: Duplicated `J' inside character alternative (pos
2)
"[JJ]"
..^
-2.elisp:43:17: In call to s2: Duplicated `B' inside character alternative (pos
2)
+2.elisp:46:17: In call to s2: Duplicated `B' inside character alternative (pos
2)
"[BB]"
..^
-2.elisp:43:31: In call to s2: Duplicated `D' inside character alternative (pos
2)
+2.elisp:46:31: In call to s2: Duplicated `D' inside character alternative (pos
2)
"[DD]"
..^
-2.elisp:43:45: In call to s2: Duplicated `F' inside character alternative (pos
2)
+2.elisp:46:45: In call to s2: Duplicated `F' inside character alternative (pos
2)
"[FF]"
..^
-2.elisp:43:59: In call to s2: Duplicated `H' inside character alternative (pos
2)
+2.elisp:46:59: In call to s2: Duplicated `H' inside character alternative (pos
2)
"[HH]"
..^
-2.elisp:43:73: In call to s2: Duplicated `J' inside character alternative (pos
2)
+2.elisp:46:73: In call to s2: Duplicated `J' inside character alternative (pos
2)
"[JJ]"
..^
-2.elisp:44:17: In call to m2: Duplicated `B' inside character alternative (pos
2)
+2.elisp:47:17: In call to m2: Duplicated `B' inside character alternative (pos
2)
"[BB]"
..^
-2.elisp:44:31: In call to m2: Duplicated `D' inside character alternative (pos
2)
+2.elisp:47:31: In call to m2: Duplicated `D' inside character alternative (pos
2)
"[DD]"
..^
-2.elisp:44:45: In call to m2: Duplicated `F' inside character alternative (pos
2)
+2.elisp:47:45: In call to m2: Duplicated `F' inside character alternative (pos
2)
"[FF]"
..^
-2.elisp:44:59: In call to m2: Duplicated `H' inside character alternative (pos
2)
+2.elisp:47:59: In call to m2: Duplicated `H' inside character alternative (pos
2)
"[HH]"
..^
-2.elisp:44:73: In call to m2: Duplicated `J' inside character alternative (pos
2)
+2.elisp:47:73: In call to m2: Duplicated `J' inside character alternative (pos
2)
"[JJ]"
..^
-2.elisp:52:17: In call to f5: Duplicated `b' inside character alternative (pos
2)
+2.elisp:55:17: In call to f5: Duplicated `b' inside character alternative (pos
2)
"[bb]"
..^
-2.elisp:52:24: In call to f5: Duplicated `c' inside character alternative (pos
2)
+2.elisp:55:24: In call to f5: Duplicated `c' inside character alternative (pos
2)
"[cc]"
..^
-2.elisp:52:31: In call to f5: Duplicated `d' inside character alternative (pos
2)
+2.elisp:55:31: In call to f5: Duplicated `d' inside character alternative (pos
2)
"[dd]"
..^
-2.elisp:55:26: In :regexp parameter: Duplicated `1' inside character
alternative (pos 2)
+2.elisp:58:26: In :regexp parameter: Duplicated `1' inside character
alternative (pos 2)
"[11]"
..^
-2.elisp:56:20: In :regex parameter: Duplicated `2' inside character
alternative (pos 2)
+2.elisp:59:20: In :regex parameter: Duplicated `2' inside character
alternative (pos 2)
"[22]"
..^
- [elpa] externals/relint 12a2b0f 08/21: Use regexp in suppression comments, (continued)
- [elpa] externals/relint 12a2b0f 08/21: Use regexp in suppression comments, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 9259a5c 03/21: Check some :value parameters in defcustom :type clauses, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint ac75b62 04/21: Check rx-to-string, and the 'regexp' and 'eval' subforms, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 09ef3df 05/21: Describe the new xr wrapped subsumption warning, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint eb178d5 06/21: Check assignments to imenu-generic-expression, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 2eba4d7 09/21: Describe new bol/eol/eos warnings, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint cf2a2ae 14/21: Do file-specific checks on arguments to known functions, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint f6d0fed 15/21: Describe the new file-specific warnings, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 1bf7f25 13/21: Check auto-mode-alist with file-specific checks, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 4fcc322 16/21: Delay call to file-relative-name until needed, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 326cfe2 11/21: Check calls to directory-files(-and-attributes),
Mattias Engdegård <=
- [elpa] externals/relint 5d3f78d 19/21: Update xr messages ("repetition" changed to "option"), Mattias Engdegård, 2020/05/03
- [elpa] externals/relint a50ed0b 20/21: Don't escape printable chars in rx warnings, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint cdd65ae 10/21: Add section about how relint works, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 636e172 12/21: Add filename-specific checks (unused so far), Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 008fad0 17/21: Repair relint-current-buffer after thunking file parameter, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint 8f49686 18/21: Move file-specific checks to xr, Mattias Engdegård, 2020/05/03
- [elpa] externals/relint a001a05 21/21: Increment version to 1.16, Mattias Engdegård, 2020/05/03