I was looking for rake tasks that would help me track down syntax errors, and I came across haml --check
as a possible solution for double checking haml files. Unfortunately, when I passed it this broken example, haml says the syntax is OK.
Have I misunderstood the purpose of haml --check
or is this feature not fully implemented?
I suppose I should mention I'm using Haml/Sass 3.0.25 (Classy Cassidy), rails 3.0.3, ruby 1.9.2p0, and Mac 10.6.6.
$ haml --check /tmp/edit.html.haml
Syntax OK
#/tmp/edit.html.haml - content_for :head do = include_javascripts :aspects #aspect_edit_pane #facebox_header %h4 = @aspect .description = t('contacts', :count =>@aspect_contacts.count)}
The last character (curly brace) should trigger a syntax error, it certainly does when the template is executed as part of a request:
ActionView::Template::Error (compile error /usr/local/app/diaspora/app/views/aspects/edit.html.haml:13: syntax error, unexpected '}', expecting ')'