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
This commit is contained in:
Stefan Kangas 2020-09-22 02:04:15 +02:00
parent c0188959c1
commit 2788557000
4 changed files with 18 additions and 1 deletions

View file

@ -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.

View file

@ -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

View file

@ -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] +\\(.*\\):$"

View file

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