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

Rails/ContentTag cop reports errors with nested content_tag corrections #450

Closed
davidenglishmusic opened this issue Mar 23, 2021 · 0 comments · Fixed by #455
Closed

Rails/ContentTag cop reports errors with nested content_tag corrections #450

davidenglishmusic opened this issue Mar 23, 2021 · 0 comments · Fixed by #455
Labels
bug Something isn't working

Comments

@davidenglishmusic
Copy link

davidenglishmusic commented Mar 23, 2021

The cop fixes the infractions correctly but throws errors while doing so. In running rubocop with the debug flag the stack trace leads to a Parser::Source::TreeRewriter detected clobbering error.


Expected behavior

To fix the infractions without errors.

Actual behavior

It fixes the infractions and states that errors occured:

An error occurred while Rails/ContentTag cop was inspecting file.rb

Steps to reproduce the problem

# file.rb
content_tag(:div, content_tag(:span, 'foo'))

bundle exec rubocop -a file.rb

RuboCop version

1.11.0 (using Parser 3.0.0.0, rubocop-ast 1.4.1, running on ruby 2.6.6 x86_64-darwin20)
  - rubocop-performance 1.10.2
  - rubocop-rails 2.9.1
  - rubocop-rspec 2.2.0
@koic koic transferred this issue from rubocop/rubocop-performance Mar 24, 2021
@koic koic added the bug Something isn't working label Mar 24, 2021
tejasbubane added a commit to tejasbubane/rubocop-rails that referenced this issue Apr 5, 2021
tejasbubane added a commit to tejasbubane/rubocop-rails that referenced this issue Apr 5, 2021
@koic koic closed this as completed in #455 Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants