From: Stefan Kangas Date: Tue, 22 Sep 2020 00:04:15 +0000 (+0200) Subject: Support shellcheck in compilation-mode X-Git-Tag: emacs-28.0.90~5940 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2788557000d91fb2a928286512c0871e64c6d79b;p=emacs.git Support shellcheck in compilation-mode * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Add shellcheck regexp. * test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data): (compile-test-error-regexps): Add test for shellcheck. * etc/compilation.txt: Add shellcheck example. * etc/NEWS: Announce the change. foo --- diff --git a/etc/NEWS b/etc/NEWS index 6bfe45a683c..a4c823072c9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -689,6 +689,9 @@ case-insensitive matching of messages when the old behavior is required, but the recommended solution is to use a correctly matching regexp instead. +--- +*** Messages from ShellCheck are now recognized. + --- *** Messages from Visual Studio that mention column numbers are now recognized. diff --git a/etc/compilation.txt b/etc/compilation.txt index 11aefc6bc6f..df0b82ebc92 100644 --- a/etc/compilation.txt +++ b/etc/compilation.txt @@ -536,6 +536,14 @@ cc-1070 cc: WARNING File = linkl.c, Line = 38 cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3 +* ShellCheck + +In autogen.sh line 38: +autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.ac` +^----------^ SC2034: autoconf_min appears unused. Verify use (or export if used externally). + ^-- SC2006: Use $(...) notation instead of legacy backticked `...`. + + * Sun Ada (VADS, Solaris) symbol: sun-ada diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 7ac5405ab18..06bdd1e98da 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -449,6 +449,9 @@ during global destruction\\.$\\)" 1 2) \\([0-9]+\\) of file://\\(.+\\)" 4 2 3 (1)) + (shellcheck + "^In \\(.+\\) line \\([0-9]+\\):" 1 2) + (sparc-pascal-file "^\\w\\w\\w \\w\\w\\w +[0-3]?[0-9] +[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\ [12][09][0-9][0-9] +\\(.*\\):$" diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index 819f2e78c2a..45eebac0367 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -324,6 +324,9 @@ 1 8 71 "/home/reto/test/group.xml") ("Warning: Start tag for undeclared element geroup\nin unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml" 1 8 4 "/home/reto/test/group.xml") + ;; shellcheck + ("In autogen.sh line 48:" + 1 nil 48 "autogen.sh") ;; sparc-pascal-file sparc-pascal-line sparc-pascal-example ("Thu May 14 10:46:12 1992 mom3.p:" 1 nil nil "mom3.p") @@ -436,7 +439,7 @@ The test data is in `compile-tests--test-regexps-data'." (compilation-num-warnings-found 0) (compilation-num-infos-found 0)) (mapc #'compile--test-error-line compile-tests--test-regexps-data) - (should (eq compilation-num-errors-found 95)) + (should (eq compilation-num-errors-found 96)) (should (eq compilation-num-warnings-found 35)) (should (eq compilation-num-infos-found 28)))))