branch: elpa/flycheck
commit c1cf9df01162a5d91634b4528be6a4d0a468ca48
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Fix yaml-yamllint patterns for errors without rule IDs
Syntax errors from yamllint don't have a trailing (rule-id), so
the ID-capturing pattern won't match them. Add fallback patterns
without ID capture for both error and warning levels.
Update test expectations: the warning now has its rule name
extracted into the :id field.
---
flycheck.el | 8 +++++++-
test/specs/languages/test-yaml.el | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/flycheck.el b/flycheck.el
index 5a20afcf2f..e51aed141f 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -12629,10 +12629,16 @@ See URL `https://github.com/adrienverge/yamllint'."
"stdin:" line ":" column ": [error] "
(message (minimal-match (one-or-more not-newline)))
" (" (id (one-or-more (not (any ")")))) ")" line-end)
+ (error line-start
+ "stdin:" line ":" column ": [error] "
+ (message) line-end)
(warning line-start
"stdin:" line ":" column ": [warning] "
(message (minimal-match (one-or-more not-newline)))
- " (" (id (one-or-more (not (any ")")))) ")" line-end))
+ " (" (id (one-or-more (not (any ")")))) ")" line-end)
+ (warning line-start
+ "stdin:" line ":" column ": [warning] "
+ (message) line-end))
:modes (yaml-mode yaml-ts-mode)
:next-checkers ((warning . cwl)))
diff --git a/test/specs/languages/test-yaml.el
b/test/specs/languages/test-yaml.el
index e670b7d3ad..bde43b153e 100644
--- a/test/specs/languages/test-yaml.el
+++ b/test/specs/languages/test-yaml.el
@@ -38,8 +38,8 @@
(let ((flycheck-disabled-checkers '(yaml-jsyaml)))
(flycheck-buttercup-should-syntax-check
"language/yaml.yaml" 'yaml-mode
- '(3 1 warning "missing document start \"---\" (document-start)"
- :checker yaml-yamllint))
+ '(3 1 warning "missing document start \"---\""
+ :id "document-start" :checker yaml-yamllint))
(flycheck-buttercup-should-syntax-check
"language/yaml.yaml" 'yaml-mode
'(4 5 error "syntax error: mapping values are not allowed here"