Why "haml -check" does not find this blatant syntax error

I was looking for rake tasks that would help me track syntax errors, and I came across haml --checkas a possible solution for double checking haml files. Unfortunately, when I gave him this broken example, haml says that the syntax is fine.

I misunderstood the purpose haml --checkor is this function not fully implemented?

I suppose I should mention that I am 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) }

( ) , , , , :

ActionView::Template::Error (compile error 
    /usr/local/app/diaspora/app/views/aspects/edit.html.haml:13: 
    syntax error, unexpected '}', expecting ')'
+3
1

, -c, --check Just check syntax, don't evaluate.

: haml .

-

, , , haml:)

haml --debug newsletter.html.haml 2> /dev/null | sed '$d' | ruby -c

:

Haml Ruby ( ), ruby ​​ .

+4

Source: https://habr.com/ru/post/1785051/


All Articles