Comments (2)
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.
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)
- Multiline pipes in JS files cause RuboCop to report "unexpected token tRCURLY"
- Haml-lint is running rubocop to lint JavaScript regex HOT 1
- False positive Rails/HttpStatus HOT 2
- Failing spec on main branch HOT 2
- Add support to Haml 6.2
- `haml-lint:disable` is ignored when line breaks on commas are present
- Add `-s`/`--stdin` option support HOT 2
- Allow Haml 6.3 HOT 3
- Haml 6.2 actions are not listed among required checks HOT 1
- Failing spec on main (local environment, up to date rubocop)
- Issue with Rubocop `Layout/IndentationConsistency` interaction with haml comment blocks HOT 2
- Version 0.53.0 has not been pushed to Rubygems HOT 1
- RuboCop: Lint/Syntax: unexpected token tSYMBOL and kEND HOT 5
- 0.54.0: Too many files open HOT 4
- Layout/ArgumentAlignment - False positive? HOT 2
- Feature Suggestion: require strict locals
- Possible false positives with Rails/FindEach
- Lint/Syntax: unexpected token kDO_BLOCK | Lint/Syntax: unexpected token kEND HOT 1
- False positive with Layout/SpaceInsideParens for multi-line attributes HOT 7
- Allow multiple reporters?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haml-lint.