Git Product home page Git Product logo

Comments (2)

hackling avatar hackling commented on July 21, 2024

Output from test failure

Run options: include {:locations=>{"./spec/haml_lint/linter/class_attribute_with_static_value_spec.rb"=>[48]}}

HamlLint::Linter::ClassAttributeWithStaticValue
  given an incorrectly structured hash
    example at ./spec/haml_lint/linter/class_attribute_with_static_value_spec.rb:53 (FAILED - 1)

Failures:

  1) HamlLint::Linter::ClassAttributeWithStaticValue given an incorrectly structured hash 
     Failure/Error: Unable to find matching line from backtrace
     Parser::SyntaxError:
       unexpected token tCOLON
     # /Users/<username>/.gem/ruby/2.1.2/gems/parser-2.2.0.pre.4/lib/parser/diagnostic/engine.rb:71:in `process'
     # /Users/<username>/.gem/ruby/2.1.2/gems/parser-2.2.0.pre.4/lib/parser/base.rb:264:in `on_error'
     # /Users/<username>/.gem/ruby/2.1.2/gems/parser-2.2.0.pre.4/lib/parser/base.rb:175:in `parse'
     # ./lib/haml_lint/ruby_parser.rb:26:in `parse'
     # ./lib/haml_lint/linter.rb:38:in `parse_ruby'
     # ./lib/haml_lint/linter/class_attribute_with_static_value.rb:30:in `block in contains_class_attribute?'
     # ./lib/haml_lint/linter/class_attribute_with_static_value.rb:28:in `each'
     # ./lib/haml_lint/linter/class_attribute_with_static_value.rb:28:in `contains_class_attribute?'
     # ./lib/haml_lint/linter/class_attribute_with_static_value.rb:19:in `visit_tag'
     # ./lib/haml_lint/haml_visitor.rb:18:in `visit'
     # ./lib/haml_lint/haml_visitor.rb:27:in `block in visit_children'
     # ./lib/haml_lint/haml_visitor.rb:27:in `each'
     # ./lib/haml_lint/haml_visitor.rb:27:in `visit_children'
     # ./lib/haml_lint/haml_visitor.rb:23:in `visit'
     # ./lib/haml_lint/linter.rb:17:in `run'
     # ./spec/support/shared_linter_context.rb:13:in `block (2 levels) in <top (required)>'

Finished in 0.00363 seconds (files took 0.64981 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/haml_lint/linter/class_attribute_with_static_value_spec.rb:53 # HamlLint::Linter::ClassAttributeWithStaticValue given an incorrectly structured hash 

from haml-lint.

sds avatar sds commented on July 21, 2024

Sorry for the delay in response, @hackling.

The issue here is that the HAML parser doesn't check the syntax of Ruby code within tag attributes (which is unfortunate).

This leaves us two options: pre-parse all code so that these errors are surfaced ahead of time, or catch and ignore them and leave it to the RuboCop checker to report them. I've opted for the latter as it's quicker for now, but I have a feeling this issue may be revisited in the future.

Anyway, for the moment this is fixed by 041802a. Thanks for the report!

from haml-lint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.