You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def foo
'Hello ' + # OPTIMIZE: Turn this into a constant.
'world'
end
LineEndConcatenation will advocate using a \ instead of a +, and will automatically correct it given the autocorrect option, but this produces invalid Ruby
$ bundle exec rubocop -a line_end_concatenation.rb
Inspecting 1 file
E
Offences:
line_end_concatenation.rb:2:12: C: [Corrected] Use \ instead of + to concatenate those strings.
'Hello ' + # OPTIMIZE: Turn this into a constant.
^
line_end_concatenation.rb:2:12: E: bare backslash only allowed before newline
'Hello ' \ # OPTIMIZE: Turn this into a constant.
^
1 file inspected, 2 offences detected, 1 offence corrected
The text was updated successfully, but these errors were encountered:
Given the following code
LineEndConcatenation will advocate using a
\
instead of a+
, and will automatically correct it given the autocorrect option, but this produces invalid RubyThe text was updated successfully, but these errors were encountered: