Open wrmk opened 7 months ago
I'm seeing this too and I think I narrowed down the source to something introduced in RuboCop v1.58. When I manually set the rubocop gem to v1.57.2, the warning doesn't appear.
Here's the full diff of all changes between v1.57.2 and 1.58.0. This change sticks out: https://github.com/rubocop/rubocop/pull/12403 Maybe that change introduced a bug for those who use slim-lint?
1| = simple_form_for @coupon do |f|
2| = f.input :strategy,
3| as: :radio_buttons,
4| collection: [%w[Amount amount], %w[Percentage percent]],
5| input_html: { \
6| data: { controller: 'uniform', action: 'toggle#toggle', toggle_target: 'actor' } }
7| = f.input :amount_off,
8| wrapper_html: { \
9| class: 'amount-off-area',
10| data: { toggle_target: 'section', toggle_show: 'amount' } } do
11| .input-prepend
12| span.add-on = current_currency.symbol
13| = f.input_field :amount_off
With gem "rubocop", "1.57.2"
in my Gemfile, slim-lint does not issue a violation for the above code. With gem "rubocop", "1.59"
in my Gemfile, here is the violation:
app/views/coupons/_form.html.slim:8 [W] RuboCop: Style/RedundantLineContinuation: Redundant line continuation.
Removing the trailing \
on line 8 makes for invalid slim.
app/views/coupons/_form.html.slim:9 [E] Expected tag
I've tried several different tweaks, but to no satisfactory avail.
What's also interesting is that the trailing \
on line 5 presents no problem ¯\_(ツ)_/¯
In my case, Rubocop (1.62.1) reports both places:
app/views/shared/_hello.html.slim:5 [W] RuboCop: Style/RedundantLineContinuation: Redundant line continuation.
app/views/shared/_hello.html.slim:8 [W] RuboCop: Style/RedundantLineContinuation: Redundant line continuation.
We are going to switch this cop off in our configuration.
I converted the file _links.html.erb from Devise gem. As the line is to long, I came with:
- if devise_mapping.lockable? && \
resource_class.unlock_strategy_enabled?(:email) && \
controller_name != 'unlocks'
and corfirm the bug:
app/views/devise/shared/_links.html.slim:12 [W] RuboCop: Style/RedundantLineContinuation: Redundant line continuation.
I'll just wait for the fix with:
# .rubocop.yml
Style/RedundantLineContinuation:
Enabled: false
Opened just a month before this issue:
I am faced with a strange problem, not sure that this is related to this gem, but I'd like to describe it. Near 2 weeks ago the command
slim-lint .
started to return false positive results:RuboCop: Style/RedundantLineContinuation: Redundant line continuation.
examples: