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 Unsafe auto correct deemed safe #436

Closed
allenwu1973 opened this issue Feb 8, 2021 · 0 comments · Fixed by #437
Closed

Rails/ContentTag Unsafe auto correct deemed safe #436

allenwu1973 opened this issue Feb 8, 2021 · 0 comments · Fixed by #437
Labels
bug Something isn't working

Comments

@allenwu1973
Copy link

Expected behavior

content_tag(*args, &block)

Should be properly converted to new syntax, or not corrected at all.

Actual behavior

It's converted to

tag(*args, &block)

Which isn't valid, as the legacy tag syntax does not support passing content.

Steps to reproduce the problem

I have a little helper in my project which triggers this.

  def concat_content_tag(*args, &block)
    concat content_tag(*args, &block)
  end

RuboCop version

1.9.1 (using Parser 3.0.0.0, rubocop-ast 1.4.1, running on ruby 2.7.2 x86_64-linux)
  - rubocop-rails 2.9.1
@koic koic added the bug Something isn't working label Feb 8, 2021
koic added a commit to koic/rubocop-rails that referenced this issue Feb 8, 2021
Fixes rubocop#436.

This PR fixes a false positive for `Rails/ContentTag`
when the first argument is a splat argument.
koic added a commit to koic/rubocop-rails that referenced this issue Feb 8, 2021
Fixes rubocop#436.

This PR fixes a false positive for `Rails/ContentTag`
when the first argument is a splat argument.
koic added a commit to koic/rubocop-rails that referenced this issue Feb 9, 2021
Fixes rubocop#436.

This PR fixes a false positive for `Rails/ContentTag`
when the first argument is a splat argument.
@koic koic closed this as completed in #437 Feb 15, 2021
koic added a commit that referenced this issue Feb 15, 2021
…t_tag

[Fix #436] Fix a false positive for `Rails/ContentTag`
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