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

    Capture rule names as error IDs in yaml-yamllint
    
    yamllint's parsable format includes rule names in parentheses
    at the end of each message (e.g. "too many blank lines (empty-lines)").
    Capture these as error IDs for filtering and suppression.
---
 flycheck.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/flycheck.el b/flycheck.el
index 2de04a4614..3de482a765 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -12617,9 +12617,13 @@ See URL `https://github.com/adrienverge/yamllint'."
             (config-file "-c" flycheck-yamllintrc))
   :error-patterns
   ((error line-start
-          "stdin:" line ":" column ": [error] " (message) line-end)
+          "stdin:" line ":" column ": [error] "
+          (message (minimal-match (one-or-more not-newline)))
+          " (" (id (one-or-more (not (any ")")))) ")" line-end)
    (warning line-start
-            "stdin:" line ":" column ": [warning] " (message) line-end))
+            "stdin:" line ":" column ": [warning] "
+            (message (minimal-match (one-or-more not-newline)))
+            " (" (id (one-or-more (not (any ")")))) ")" line-end))
   :modes (yaml-mode yaml-ts-mode)
   :next-checkers ((warning . cwl)))
 

Reply via email to