Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto correct broken in rubocop 0.82, NoMethodError: undefined method `begin_pos' for s(:str, "..."):RuboCop::AST::StrNode #162

Closed
Fonsan opened this issue Apr 29, 2020 · 0 comments · Fixed by #172

Comments

@Fonsan
Copy link

Fonsan commented Apr 29, 2020

Exception occured when processing: app/views/statistics/_find_question_form.html.erb
If this file cannot be processed by erb-lint, you can exclude it in your configuration file.
cause: #<NoMethodError: undefined method `begin_pos' for s(:str, "questions_for_form"):RuboCop::AST::StrNode
Did you mean?  begin_type?>
/Users/fonsan/.rvm/gems/ruby-2.6.6@dok/gems/rubocop-0.82.0/lib/rubocop/cop/cop.rb:38:in `rescue in call'
/Users/fonsan/.rvm/gems/ruby-2.6.6@dok/gems/rubocop-0.82.0/lib/rubocop/cop/cop.rb:35:in `call'
/Users/fonsan/.rvm/gems/ruby-2.6.6@dok/gems/erb_lint-0.0.32/lib/erb_lint/linters/rubocop.rb:48:in `block in autocorrect'
/Users/fonsan/.rvm/gems/ruby-2.6.6@dok/gems/rubocop-0.82.0/lib/rubocop/cop/corrector.rb:63:in `block (2 levels) in rewrite'
/Users/fonsan/.rvm/gems/ruby-2.6.6@dok/gems/parser-2.7.1.1/lib/parser/source/tree_rewriter.rb:256:in `transaction'
/Users/fonsan/.rvm/gems/ruby-2.6.6@dok/gems/rubocop-0.82.0/lib/rubocop/cop/corrector.rb:62:in `block in rewrite'

I have tracked it down to this change which allows for other things than source ranges to pass through. Not sure if I will have to the time to fix it but leaving this here for the googles

rubocop/rubocop#7863

pftg added a commit to jetthoughts/erb-lint that referenced this issue May 22, 2020
Rubocop changed interface and after
rubocop/rubocop#7863 it requires correctors
to accept nodes.

Closes Shopify#162
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant