branch: elpa/flycheck
commit 95f403405bfa1672aeddc089b6106775f301b706
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Include info-level errors in mode-line indicator
    
    The mode-line now shows errors, warnings, and info counts in the
    format E|W|I instead of just E|W.  This makes info-level issues
    (e.g. from ShellCheck) visible in the status line.
    
    Fixes #2134
---
 flycheck.el                  | 5 +++--
 test/specs/test-mode-line.el | 9 +++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/flycheck.el b/flycheck.el
index 7a2d4534ee..3b339f13ab 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -4206,8 +4206,9 @@ nil."
                       (`errored "!")
                       (`finished
                        (let-alist (flycheck-count-errors 
flycheck-current-errors)
-                         (if (or .error .warning)
-                             (format ":%s|%s" (or .error 0) (or .warning 0))
+                         (if (or .error .warning .info)
+                             (format ":%s|%s|%s" (or .error 0) (or .warning 0)
+                                     (or .info 0))
                            flycheck-mode-success-indicator)))
                       (`interrupted ".")
                       (`suspicious "?")))
diff --git a/test/specs/test-mode-line.el b/test/specs/test-mode-line.el
index 8a6fab3229..83aa79d16a 100644
--- a/test/specs/test-mode-line.el
+++ b/test/specs/test-mode-line.el
@@ -28,18 +28,19 @@
 (require 'flycheck-buttercup)
 
 (describe "Mode Line"
-  (it "shows the number of errors and warnings"
+  (it "shows the number of errors, warnings, and infos"
     (let ((flycheck-current-errors
            (list (flycheck-error-new-at 1 1 'warning "warning 1")
                  (flycheck-error-new-at 2 2 'warning "warning 2")
                  (flycheck-error-new-at 1 1 'error "error"))))
       (expect (flycheck-mode-line-status-text 'finished)
-              :to-equal " FlyC:1|2")))
+              :to-equal " FlyC:1|2|0")))
 
-  (it "does not show the number of infos"
+  (it "shows the number of infos"
     (let ((flycheck-current-errors
            (list (flycheck-error-new-at 1 1 'info "info"))))
-      (expect (flycheck-mode-line-status-text 'finished) :to-equal " FlyC:0")))
+      (expect (flycheck-mode-line-status-text 'finished)
+              :to-equal " FlyC:0|0|1")))
 
   (it "includes the prefix"
     (let ((flycheck-mode-line-prefix "foobar")

Reply via email to