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
@prettier/plugin-ruby
prettier
rubyHashLabel
rubyModifier
rubySingleQuote
rubyToProc
trailingComma
This code is the prettified output:
Artist.where(name: names).select(:name).select_more do max(:id).as(:id) end.group(:name)
Running rubocop on the code above unfortunately returns the following error (this rule is enabled by default):
C: Style/MultilineBlockChain: Avoid multi-line chains of blocks.
We should disable Style/MultilineBlockChain in the plugin-ruby rubocop configuration.
The text was updated successfully, but these errors were encountered:
As of latest main this will result in:
Artist .where(name: names) .select(:name) .select_more { max(:id).as(:id) } .group(:name)
which shouldn't violate the rubocop rule.
Sorry, something went wrong.
@kddnewton It seems that there is still an issue with the latest version: The prettified output of this code:
my_hash .map { |my_key, my_long_value| { this_is_the_type: my_key, this_is_the_value: my_long_value } } .filter { |item| item[:this_is_the_value].present? }
Would be:
my_hash .map do |my_key, my_long_value| { this_is_the_type: my_key, this_is_the_value: my_long_value } end .filter { |item| item[:this_is_the_value].present? }
Which results in RuboCop: Avoid multi-line chains of blocks. [Style/MultilineBlockChain]
RuboCop: Avoid multi-line chains of blocks. [Style/MultilineBlockChain]
@bentwistbsc fair enough. I just pushed up disabling Style/MultilineBlockChain in the shipped config, that'll be out in the next release.
Style/MultilineBlockChain
Successfully merging a pull request may close this issue.
Metadata
@prettier/plugin-ruby
orprettier
gem version: 1.5.5rubyHashLabel
rubyModifier
rubySingleQuote
rubyToProc
trailingComma
Current output
This code is the prettified output:
Running rubocop on the code above unfortunately returns the following error (this rule is enabled by default):
We should disable Style/MultilineBlockChain in the plugin-ruby rubocop configuration.
The text was updated successfully, but these errors were encountered: