Skip to content

Commit

Permalink
Make Haml-Syntax-Checker compatible with haml ~> 5.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaMoe authored and tg-digineo committed Nov 9, 2017
1 parent ee7cb6d commit 468aa61
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -7723,7 +7723,8 @@ See URL `http://haml.info'."
:command ("haml" "-c" "--stdin")
:standard-input t
:error-patterns
((error line-start "Syntax error on line " line ": " (message) line-end))
((error line-start "Syntax error on line " line ": " (message) line-end)
(error line-start ":" line ": syntax error, " (message) line-end))
:modes haml-mode)

(flycheck-define-checker handlebars
Expand Down
10 changes: 8 additions & 2 deletions test/flycheck-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -3241,12 +3241,18 @@ See https://github.com/flycheck/flycheck/issues/531 and Emacs bug #19206"))
"language/groovy.groovy" 'groovy-mode
'(2 14 error "unexpected token: {" :checker groovy)))

(flycheck-ert-def-checker-test haml haml nil
(flycheck-ert-def-checker-test haml haml "haml-error"
(flycheck-ert-should-syntax-check
"language/haml.haml" 'haml-mode
"language/haml/haml-error.haml" 'haml-mode
'(5 nil error "Inconsistent indentation: 3 spaces used for indentation, but the rest of the document was indented using 2 spaces."
:checker haml)))

(flycheck-ert-def-checker-test haml haml "ruby-error"
(flycheck-ert-should-syntax-check
"language/haml/ruby-error.haml" 'haml-mode
'(1 nil error "unexpected end-of-input"
:checker haml)))

(flycheck-ert-def-checker-test handlebars handlebars nil
(flycheck-ert-should-syntax-check
"language/handlebars.hbs" '(handlebars-mode web-mode)
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions test/resources/language/haml/ruby-error.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- foo.each do

0 comments on commit 468aa61

Please sign in to comment.