emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0bffb3e: Make ant regexp in compilation-error-regexp-alist-alist


From: Filipp Gunbin
Subject: master 0bffb3e: Make ant regexp in compilation-error-regexp-alist-alist more lax
Date: Fri, 1 Nov 2019 08:24:13 -0400 (EDT)

branch: master
commit 0bffb3e69d4f45b4f4bc553af3ed6e78cfd6bd49
Author: Filipp Gunbin <address@hidden>
Commit: Filipp Gunbin <address@hidden>

    Make ant regexp in compilation-error-regexp-alist-alist more lax
    
    * lisp/progmodes/compile.el: Make ant regexp accept filenames that may
    occur on Cygwin (like c:/test) and optional additional severity level
    after task name.
    * etc/compilation.txt: Add sample.
---
 etc/compilation.txt                  |  9 +++++----
 lisp/progmodes/compile.el            |  7 +++++--
 test/lisp/progmodes/compile-tests.el | 18 +++++++++++++-----
 3 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/etc/compilation.txt b/etc/compilation.txt
index 4a4a318..7cd33bb 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -49,10 +49,11 @@ The regexps found on http://ant.apache.org/faq.html, and 
since
 integrated in both Emacsen, were hairy.  The extra two numbers for
 jikes are the ending line and ending column.
 
-    [javac] /src/DataBaseTestCase.java:27: unreported exception ...
-    [javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot 
complete normally
-    [jikes]  foo.java:3:5:7:9: blah blah
-  [javadoc] c:\MyProject\Polynomial.java:560: error: unknown tag: math
+       [javac] /src/DataBaseTestCase.java:27: unreported exception ...
+       [javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot 
complete normally
+      [jikes]  foo.java:3:5:7:9: blah blah
+     [javadoc] c:\MyProject\Polynomial.java:560: error: unknown tag: math
+  [checkstyle] [ERROR] /src/Test.java:38: warning: foo: bar
 
 
 * Bash v2
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index b0bb728..f412dbc 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -181,9 +181,12 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
     (aix
      " in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
 
+    ;; Checkstyle task may report its own severity level: "[checkstyle] 
[ERROR] ..."
+    ;; (see AuditEventDefaultFormatter.java in checkstyle sources).
     (ant
-     "^[ \t]*\\[[^] \n]+\\][ \t]*\\(\\(?:[A-Za-z]:\\\\\\)?[^: 
\n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\)?\
-\\( warning\\)?" 1 (2 . 4) (3 . 5) (6))
+     "^[ \t]*\\(?:\\[[^] \n]+\\][ \t]*\\)\\{1,2\\}\\(\\(?:[A-Za-z]:\\)?[^: 
\n]+\\):\
+\\([0-9]+\\):\\(?:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\)?\\( warning\\)?"
+     1 (2 . 4) (3 . 5) (6))
 
     (bash
      "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2)
diff --git a/test/lisp/progmodes/compile-tests.el 
b/test/lisp/progmodes/compile-tests.el
index e38c31d..4c2ce83 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -55,11 +55,19 @@
      25 nil 8 "errors.c")
     ;; ant
     ("[javac] /src/DataBaseTestCase.java:27: unreported exception ..."
-     13 nil 27 "/src/DataBaseTestCase.java")
+     13 nil 27 "/src/DataBaseTestCase.java" 2)
     ("[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot 
complete normally"
-     13 nil 49 "/src/DataBaseTestCase.java")
+     13 nil 49 "/src/DataBaseTestCase.java" 1)
     ("[jikes]  foo.java:3:5:7:9: blah blah"
-     14 (5 . 10) (3 . 7) "foo.java")
+     14 (5 . 10) (3 . 7) "foo.java" 2)
+    ("[javac] c:/cygwin/Test.java:12: error: foo: bar"
+     9 nil 12 "c:/cygwin/Test.java" 2)
+    ("[javac] c:\\cygwin\\Test.java:87: error: foo: bar"
+     9 nil 87 "c:\\cygwin\\Test.java" 2)
+    ;; Checkstyle error, but ant reports a warning (note additional
+    ;; severity level after task name)
+    ("[checkstyle] [ERROR] /src/Test.java:38: warning: foo"
+     22 nil 38 "/src/Test.java" 1)
     ;; bash
     ("a.sh: line 1: ls-l: command not found"
      1 nil 1 "a.sh")
@@ -420,8 +428,8 @@ 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 90))
-      (should (eq compilation-num-warnings-found 35))
+      (should (eq compilation-num-errors-found 92))
+      (should (eq compilation-num-warnings-found 36))
       (should (eq compilation-num-infos-found 26)))))
 
 (ert-deftest compile-test-grep-regexps ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]