emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/idris-mode c5f42964bf 02/10: [ flycheck ] patterns work, b


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode c5f42964bf 02/10: [ flycheck ] patterns work, but issue is parsing the output.
Date: Wed, 18 Jan 2023 07:59:53 -0500 (EST)

branch: elpa/idris-mode
commit c5f42964bf1fa8cbc4ad4827b1868c2ba4a39417
Author: Jan de Muijnck-Hughes <jan.deMuijnck-Hughes@glasgow.ac.uk>
Commit: Marek L <nospam.keram@gmail.com>

    [ flycheck ] patterns work, but issue is parsing the output.
    
    Flycheck expects a 'proper name'.
---
 flycheck-idris.el      |  3 +--
 idris-test-flycheck.el | 50 +++++++++++++++++++++++++++++++++++---------------
 2 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/flycheck-idris.el b/flycheck-idris.el
index 1570aa1c0d..c961ac32e5 100644
--- a/flycheck-idris.el
+++ b/flycheck-idris.el
@@ -48,8 +48,7 @@
 (flycheck-define-checker idris2
   "An Idris2 syntax and type checker."
   :command ("idris2"
-            "-q"
-            "--check" "--nocolor" "--warnpartial"
+            "--check" "--no-colour"
             ;; Compute the command-line options similarly to inferior-idris
             (eval (idris-compute-flags))
             source)
diff --git a/idris-test-flycheck.el b/idris-test-flycheck.el
index 5fadfcdc7e..92b2d228ea 100644
--- a/idris-test-flycheck.el
+++ b/idris-test-flycheck.el
@@ -1,4 +1,5 @@
 (require 'flycheck)
+(require 'flycheck-ert)
 (require 'idris-mode)
 (require 'flycheck-idris)
 (require 'idris-commands)
@@ -9,21 +10,40 @@
 
 ;;; Code:
 
-(flycheck-parse-error-with-patterns
-(concat "Warning: We are about to implicitly bind the following lowercase 
names.\n"
-        "You may be unintentionally shadowing the associated global 
definitions:\n"
-        "  plus is shadowing Main.plus, Prelude.Types.plus\n"
-        "\n"
-        "Temp:5:3--5:4\n"
-        " 1 | plus : Nat -> Nat -> Nat    \n"
-        " 2 | plus x y = plus x \"w\"      \n"
-        " 3 |                             \n"
-        " 4 | data Foo : Nat -> Type where\n"
-        " 5 |   F : Foo plus              \n"
-        "       ^                         \n"
-        "\n")
-(flycheck-checker-get 'idris2 'error-patterns)
-'idris2)
+(ert-deftest idris2-test-flycheck-warning ()
+  "Test parsing of warnings with flycheck."
+  (should (eql
+           (flycheck-parse-error-with-patterns
+            (concat "Warning: We are about to implicitly bind the following 
lowercase names.\n"
+                    "You may be unintentionally shadowing the associated 
global definitions:\n"
+                    "  plus is shadowing Main.plus, Prelude.Types.plus\n"
+                    "\n"
+                    "Temp:5:3--5:4\n"
+                    " 1 | plus : Nat -> Nat -> Nat    \n"
+                    " 2 | plus x y = plus x \"w\"      \n"
+                    " 3 |                             \n"
+                    " 4 | data Foo : Nat -> Type where\n"
+                    " 5 |   F : Foo plus              \n"
+                    "       ^                         \n"
+                    "\n\n")
+            (flycheck-checker-get 'idris2 'error-patterns) 'idris2)
+           (flycheck-error-new
+            :filename "Temp"
+            :checker 'idris2
+
+            :line 5
+            :column 3
+            :end-column 5
+            :level 'warning
+            :id nil
+            :message (concat
+                      "Warning: We are about to implicitly bind the following 
lowercase names.\n"
+                      "You may be unintentionally shadowing the associated 
global definitions:\n"
+                      "  plus is shadowing Main.plus, Prelude.Types.plus\n"
+                      "\n"))))
+  )
+
+;;; Hand tests
 
 (flycheck-parse-error-with-patterns
  (concat "Error: While processing right hand side of plus. Ambiguous 
elaboration. Possible results:\n"



reply via email to

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