unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Scan of Emacs regexp mistakes
@ 2020-04-05 12:30 Mattias Engdegård
  2020-04-14 10:52 ` Mattias Engdegård
  0 siblings, 1 reply; 10+ messages in thread
From: Mattias Engdegård @ 2020-04-05 12:30 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 526 bytes --]

A new scan of irregularities and errors in regexps in the Emacs tree, using an experimental version of relint/xr.
New checks include ones specific to file names, more elaborate subsumption checks, and rx-specific checks. All are designed to avoid false positives; comments are very welcome!

For an explanation of individual diagnostics, see
https://github.com/mattiase/relint/blob/master/README.
Do ask if you find anything unclear.

(I will take care of those in rx-tests.el; they probably just need suppressing.)


[-- Attachment #2: relint.log --]
[-- Type: application/octet-stream, Size: 15861 bytes --]

Relint results for ~/emacs      -*- compilation -*-
lisp/calendar/todo-mode.el:710:66: Use \' instead of $ in file-matching regexp (pos 8)
  ".*\\.todr$"
   .........^
lisp/calendar/todo-mode.el:4057:62: Use \' instead of $ in file-matching regexp (pos 10)
  "\\.tod[rty]$"
   ...........^
lisp/calendar/todo-mode.el:4190:65: Use \' instead of $ in file-matching regexp (pos 8)
  ".*\\.todr$"
   .........^
lisp/calendar/todo-mode.el:6157:71: Use \' instead of $ in file-matching regexp (pos 10)
  "\\.tod[rty]$"
   ...........^
lisp/calendar/todo-mode.el:6210:66: Use \' instead of $ in file-matching regexp (pos 6)
  "\\.todr$"
   .......^
lisp/calendar/todo-mode.el:6239:66: Use \' instead of $ in file-matching regexp (pos 6)
  "\\.todr$"
   .......^
lisp/calendar/todo-mode.el:6265:70: Use \' instead of $ in file-matching regexp (pos 10)
  "\\.tod[rty]$"
   ...........^
lisp/cedet/semantic/db-ebrowse.el:184:31: Possibly unescaped ‘.’ in file-matching regexp (pos 11)
  "BROWSE-load.el$"
   ...........^
lisp/cedet/semantic/db-ebrowse.el:184:31: Use \' instead of $ in file-matching regexp (pos 14)
  "BROWSE-load.el$"
   ..............^
lisp/cedet/semantic/texi.el:498:59: Use \' instead of $ in file-matching regexp (pos 6)
  "\\.texi$"
   .......^
lisp/cedet/srecode/map.el:330:50: Use \' instead of $ in file-matching regexp (pos 5)
  "\\.srt$"
   ......^
lisp/emacs-lisp/autoload.el:1054:53: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[^=.].*\\(\\`a\\`\\)\\'"
   ^
lisp/emacs-lisp/shadow.el:102:56: Possibly unescaped ‘.’ in file-matching regexp (pos 0)
  ".\\.elc?\\(\\.gz\\)?$"
   ^
lisp/emacs-lisp/shadow.el:102:76: Use \' instead of $ in file-matching regexp (pos 16)
  ".\\.elc?\\(\\.gz\\)?$"
   ....................^
lisp/erc/erc-dcc.el:634:39: In erc-dcc-ctcp-query-send-regexp: Repetition of expression matching an empty string (pos 30)
  "^DCC SEND \\(\"\\(\\(.*?\\(\\\\\"\\)?\\)+?\\)\"\\|\\([^ ]+\\)\\) \\([0-9]+\\) \\([0-9]+\\) *\\([0-9]*\\)"
   ........................................^
lisp/gnus/gnus-agent.el:2077:42: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/gnus-agent.el:2077:49: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/gnus-agent.el:3853:78: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/gnus-agent.el:3853:85: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/gnus-agent.el:4113:37: Use \` instead of ^ in file-matching regexp (pos 0)
  "^-?[0-9]+$"
   ^
lisp/gnus/gnus-agent.el:4113:46: Use \' instead of $ in file-matching regexp (pos 9)
  "^-?[0-9]+$"
   .........^
lisp/gnus/gnus-cache.el:504:53: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/gnus-cache.el:504:60: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/gnus-score.el:2984:29: Use \' instead of $ in file-matching regexp (pos 18)
  "\\(SCORE\\|ADAPT\\)\\'$"
   ......................^
lisp/gnus/gnus-util.el:771:32: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ^
lisp/gnus/gnus-util.el:771:59: Possibly unescaped ‘.’ in file-matching regexp (pos 21)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ...........................^
lisp/gnus/gnus-uu.el:1677:56: Use \' instead of $ in file-matching regexp (pos 15)
  "[^/][^\\.][^\\.]?$"
   .................^
lisp/gnus/nndraft.el:222:55: Use \` instead of ^ in file-matching regexp (pos 0)
  "^#[0-9]+#$"
   ^
lisp/gnus/nndraft.el:222:64: Use \' instead of $ in file-matching regexp (pos 9)
  "^#[0-9]+#$"
   .........^
lisp/gnus/nnmh.el:175:55: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/nnmh.el:175:62: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/nnmh.el:363:60: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/nnmh.el:363:67: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/nnmh.el:374:64: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/nnmh.el:374:71: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/nnmh.el:488:55: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/nnmh.el:488:62: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/nnmh.el:512:53: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/nnmh.el:512:60: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/nnspool.el:263:56: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[0-9]+$"
   ^
lisp/gnus/nnspool.el:263:63: Use \' instead of $ in file-matching regexp (pos 7)
  "^[0-9]+$"
   .......^
lisp/gnus/spam-stat.el:560:41: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[^.]"
   ^
lisp/gnus/spam-stat.el:604:41: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[^.]"
   ^
lisp/international/quail.el:3062:61: Use \' instead of $ in file-matching regexp (pos 4)
  "\\.el$"
   .....^
lisp/international/titdic-cnv.el:556:62: Use \' instead of $ in file-matching regexp (pos 5)
  "\\.tit$"
   ......^
lisp/mail/mspools.el:226:38: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[^.]+\\.spool"
   ^
lisp/mail/mspools.el:360:36: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[^.]+\\.spool$"
   ^
lisp/mail/mspools.el:360:36: Use \' instead of $ in file-matching regexp (pos 13)
  "^[^.]+\\.spool$"
   ..............^
lisp/mail/rmail.el:1638:46: Use \' instead of $ in file-matching regexp (pos 7)
  "\\.xmail$"
   ........^
lisp/mail/rmail.el:4426:39: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[A-Z0-9]+\\(\\.[A-Z0-9]+\\)?$"
   ^
lisp/mail/rmail.el:4426:39: Use \' instead of $ in file-matching regexp (pos 26)
  "^[A-Z0-9]+\\(\\.[A-Z0-9]+\\)?$"
   .............................^
lisp/net/ange-ftp.el:4174:26: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ^
lisp/net/ange-ftp.el:4174:53: Possibly unescaped ‘.’ in file-matching regexp (pos 21)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ...........................^
lisp/net/puny.el:38:36: In call to string-match: End-of-text anchor followed by non-empty pattern (pos 13)
  "\\'[[:ascii:]]+\\'"
   ..............^
lisp/net/tramp-adb.el:59:56: In tramp-adb-prompt: Repetition subsumes preceding repetition (pos 50)
  "^[[:digit:]]*|?[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*[#\\$][[:space:]]"
   ....................................................^
lisp/net/tramp-loaddefs.el:23:80: In tramp-adb-prompt: Repetition subsumes preceding repetition (pos 50)
  "^[[:digit:]]*|?[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*[#\\$][[:space:]]"
   ....................................................^
lisp/net/tramp.el:2467:40: Use \` instead of ^ in file-matching regexp (pos 0)
  "^tramp.+\\.elc?$"
   ^
lisp/net/tramp.el:2467:55: Use \' instead of $ in file-matching regexp (pos 14)
  "^tramp.+\\.elc?$"
   ...............^
lisp/obsolete/gulp.el:97:49: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[^=].*\\.el$"
   ^
lisp/obsolete/gulp.el:97:61: Use \' instead of $ in file-matching regexp (pos 11)
  "^[^=].*\\.el$"
   ............^
lisp/obsolete/vc-arch.el:600:60: Possibly unescaped ‘.’ in file-matching regexp (pos 6)
  "[^.]\\|..."
   .......^
lisp/obsolete/vc-arch.el:600:61: Possibly unescaped ‘.’ in file-matching regexp (pos 7)
  "[^.]\\|..."
   ........^
lisp/obsolete/vc-arch.el:600:62: Possibly unescaped ‘.’ in file-matching regexp (pos 8)
  "[^.]\\|..."
   .........^
lisp/obsolete/vc-arch.el:605:67: Possibly unescaped ‘.’ in file-matching regexp (pos 6)
  "[^.]\\|..."
   .......^
lisp/obsolete/vc-arch.el:605:68: Possibly unescaped ‘.’ in file-matching regexp (pos 7)
  "[^.]\\|..."
   ........^
lisp/obsolete/vc-arch.el:605:69: Possibly unescaped ‘.’ in file-matching regexp (pos 8)
  "[^.]\\|..."
   .........^
lisp/obsolete/vc-arch.el:611:67: Possibly unescaped ‘.’ in file-matching regexp (pos 6)
  "[^.]\\|..."
   .......^
lisp/obsolete/vc-arch.el:611:68: Possibly unescaped ‘.’ in file-matching regexp (pos 7)
  "[^.]\\|..."
   ........^
lisp/obsolete/vc-arch.el:611:69: Possibly unescaped ‘.’ in file-matching regexp (pos 8)
  "[^.]\\|..."
   .........^
lisp/org/ob-core.el:3058:35: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ^
lisp/org/ob-core.el:3058:62: Possibly unescaped ‘.’ in file-matching regexp (pos 21)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ...........................^
lisp/org/org-table.el:2008:52: In call to re-search-forward: Last item in repetition subsumes first item (wrapped) (pos 15)
  "\\([ \t]*\n[ \t]*\\)+"
   ....................^
lisp/progmodes/ebnf2ps.el:4944:35: Use \' instead of $ in file-matching regexp (pos 14)
  "\\.[Bb][Nn][Ff]$"
   ...............^
lisp/progmodes/executable.el:158:47: Use \` instead of ^ in file-matching regexp (pos 0)
  "^[^.]"
   ^
lisp/progmodes/gdb-mi.el:1847:3: In gdb-control-commands-regexp: Escaped non-special character ‘e’ (pos 205)
  "^\\(comm\\(a\\(n\\(ds?\\)?\\)?\\)?\\|if\\|while\\|def\\(i\\(ne?\\)?\\)?\\|doc\\(u\\(m\\(e\\(nt?\\)?\\)?\\)?\\)?\\|python\\|python-interactive\\|pi\\|guile\\|guile-repl\\|gr\\|while-stepping\\|stepp\\(i\\(ng?\\)?\\)?\\|ws\\|actions\\|expl\\(o\\(r\\e?\\)?\\)?\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)*$"
   .....................................................................................................................................................................................................................................................^
lisp/progmodes/scheme.el:150:40: In imenu-generic-expression: Repetition of expression matching an empty string (pos 50)
  "^(define\\(\\|-\\(generic\\(\\|-procedure\\)\\|method\\)\\)*\\s-+(?\\(\\sw+\\)"
   ...........................................................^
lisp/textmodes/refer.el:380:62: Use \' instead of $ in file-matching regexp (pos 5)
  "\\.bib$"
   ......^
lisp/textmodes/sgml-mode.el:290:32: In sgml-start-tag-regex: Repetition subsumes preceding repetition (pos 62)
  "<[_:[:alpha:]][-_.:[:alnum:]]*\\(?:[^\"'/><]\\|\"[^\"]*\"\\|'[^']*'\\)*"
   ......................................................................^
lisp/textmodes/sgml-mode.el:597:31: In paragraph-start: Repetition subsumes preceding repetition (pos 79)
  "[ \t]*$\\|[ \t]*</?\\([_:[:alpha:]][-_.:[:alnum:]]*\\(?:[^\"'/><]\\|\"[^\"]*\"\\|'[^']*'\\)*\\)?>"
   ...........................................................................................^
lisp/url/url-about.el:40:57: Use \` instead of ^ in file-matching regexp (pos 0)
  "^url-.*\\.el$"
   ^
lisp/url/url-about.el:40:69: Use \' instead of $ in file-matching regexp (pos 11)
  "^url-.*\\.el$"
   ............^
lisp/vc/diff-mode.el:1463:8: In imenu-generic-expression: Escaped non-special character ‘ ’ (pos 6)
  "\\+\\+\\+\\ \\([^\t\n]+\\)[\t\n]"
   .........^
lisp/vc/vc-rcs.el:250:43: Use \' instead of $ in file-matching regexp (pos 4)
  ".*,v$"
   ....^
lisp/vc/vc-rcs.el:316:35: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^.]\\|\\.[^.]\\|\\.\\.[^.]\\).*"
   ^
lisp/arc-mode.el:2035:42: In call to re-search-forward: First item in repetition subsumes last item (wrapped) (pos 11)
  "^\\( +=+ *\\)+\n"
   .............^
lisp/auth-source-pass.el:193:52: Use \' instead of $ in file-matching regexp (pos 5)
  "\\.gpg$"
   ......^
lisp/dired.el:3261:60: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ^
lisp/dired.el:3261:60: Possibly unescaped ‘.’ in file-matching regexp (pos 21)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ...........................^
lisp/files.el:2638:3: Possibly unescaped ‘.’ in file-matching regexp (pos 8)
  "\\.ad[bs].dg\\'"
   .........^
lisp/files.el:2638:3: Possibly unescaped ‘.’ in file-matching regexp (pos 11)
  "/\\.redshift.conf\\'"
   ............^
lisp/files.el:5785:41: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ^
lisp/files.el:5785:41: Possibly unescaped ‘.’ in file-matching regexp (pos 21)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ...........................^
lisp/files.el:5807:33: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ^
lisp/files.el:5807:33: Possibly unescaped ‘.’ in file-matching regexp (pos 21)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ...........................^
lisp/files.el:5930:33: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ^
lisp/files.el:5930:33: Possibly unescaped ‘.’ in file-matching regexp (pos 21)
  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
   ...........................^
lisp/finder.el:198:57: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\([^=].*\\)\\.el\\(\\.\\(gz\\|Z\\)\\)?$"
   ^
lisp/finder.el:198:57: Use \' instead of $ in file-matching regexp (pos 31)
  "^\\([^=].*\\)\\.el\\(\\.\\(gz\\|Z\\)\\)?$"
   ........................................^
lisp/generic-x.el:1433:16: Possibly unescaped ‘.’ in file-matching regexp (pos 10)
  "/etc/inetd.conf\\'"
   ..........^
lisp/generic-x.el:1633:16: Possibly unescaped ‘.’ in file-matching regexp (pos 10)
  "/etc/named.boot\\'"
   ..........^
lisp/generic-x.el:1670:21: Possibly unescaped ‘.’ in file-matching regexp (pos 15)
  "/etc/resolv[e]?.conf\\'"
   ...............^
lisp/generic-x.el:1806:18: Possibly unescaped ‘.’ in file-matching regexp (pos 12)
  "/etc/modules.conf"
   ............^
lisp/generic-x.el:1806:35: Possibly unescaped ‘.’ in file-matching regexp (pos 9)
  "/etc/conf.modules"
   .........^
lisp/help-fns.el:626:58: Possibly unescaped ‘.’ in file-matching regexp (pos 6)
  "\\`NEWS.[1-9]"
   .......^
lisp/help.el:364:40: Use \` instead of ^ in file-matching regexp (pos 0)
  "^NEWS\\.[0-9][-0-9]*$"
   ^
lisp/help.el:364:60: Use \' instead of $ in file-matching regexp (pos 19)
  "^NEWS\\.[0-9][-0-9]*$"
   ....................^
lisp/startup.el:1376:36: Use \` instead of ^ in file-matching regexp (pos 0)
  "^\\.emacs\\(\\.elc?\\)?$"
   ^
lisp/startup.el:1376:59: Use \' instead of $ in file-matching regexp (pos 19)
  "^\\.emacs\\(\\.elc?\\)?$"
   .......................^
lisp/startup.el:1379:36: Use \` instead of ^ in file-matching regexp (pos 0)
  "^_emacs\\(\\.elc?\\)?$"
   ^
lisp/startup.el:1379:57: Use \' instead of $ in file-matching regexp (pos 18)
  "^_emacs\\(\\.elc?\\)?$"
   .....................^
test/lisp/emacs-lisp/rx-tests.el:66:51: Range ‘<-]’ overlaps previous ‘]-{’
test/lisp/emacs-lisp/rx-tests.el:130:34: Duplicated character ‘-’ (pos 1)
  "c-"
   .^
test/lisp/emacs-lisp/rx-tests.el:130:38: Single-character range ‘f-f’ (pos 0)
  "f-f"
   ^
test/lisp/emacs-lisp/rx-tests.el:130:44: Range ‘--/’ overlaps previous ‘-’ (pos 0)
  "--/*--"
   ^
test/lisp/emacs-lisp/rx-tests.el:130:47: Range ‘*--’ overlaps previous ‘--/’ (pos 3)
  "--/*--"
   ...^
test/lisp/emacs-lisp/rx-tests.el:143:42: Duplicated class ‘space’
test/lisp/net/tramp-archive-tests.el:671:68: Use \` instead of ^ in file-matching regexp (pos 0)
  "^b"
   ^
test/lisp/net/tramp-tests.el:3356:71: Use \` instead of ^ in file-matching regexp (pos 0)
  "^b"
   ^

Finished -- 118 errors (2 suppressed).

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-04-16 18:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-05 12:30 Scan of Emacs regexp mistakes Mattias Engdegård
2020-04-14 10:52 ` Mattias Engdegård
2020-04-14 11:15   ` Andreas Schwab
2020-04-16 10:15     ` Mattias Engdegård
2020-04-14 15:47   ` Drew Adams
2020-04-15 18:19   ` Paul Eggert
2020-04-16 10:29     ` Mattias Engdegård
2020-04-16 10:37   ` Mattias Engdegård
2020-04-16 16:08     ` Paul Eggert
2020-04-16 18:01       ` Mattias Engdegård

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).