We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
def foo(options = {}) content_tag :div, { class: "strong" }.merge(options) do "body" end end
is auto-corrected to invalid Ruby code by
$ rubocop --auto-correct --only Rails/ContentTag
def foo(options = {}) tag.div({ class: "strong" }.merge(options)) do "body" end end
We must add the parens if content_tag is called with block and the option argument starts with hash literal.
content_tag
def foo(options = {}) tag.div { class: "strong" }.merge(options) do "body" end end
$ bundle exec rubocop -V 0.85.1 (using Parser 2.7.1.3, rubocop-ast 0.0.3, running on ruby 2.6.3 x86_64-darwin18) $ bundle exec gem list rubocop-rails *** LOCAL GEMS *** rubocop-rails (2.6.0)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
is auto-corrected to invalid Ruby code by
Expected behavior
We must add the parens if
content_tag
is called with block and the option argument starts with hash literal.Actual behavior
RuboCop version
The text was updated successfully, but these errors were encountered: