diff --git a/lib/rubocop/cop/performance/chain_array_allocation.rb b/lib/rubocop/cop/performance/chain_array_allocation.rb index 1c65c96fb3..840ecf5cf3 100644 --- a/lib/rubocop/cop/performance/chain_array_allocation.rb +++ b/lib/rubocop/cop/performance/chain_array_allocation.rb @@ -47,8 +47,8 @@ class ChainArrayAllocation < Base RETURNS_NEW_ARRAY = (ALWAYS_RETURNS_NEW_ARRAY + RETURNS_NEW_ARRAY_WHEN_NO_BLOCK).freeze - MSG = 'Use unchained `%s` and `%s!` '\ - '(followed by `return array` if required) instead of chaining '\ + MSG = 'Use unchained `%s` and `%s!` ' \ + '(followed by `return array` if required) instead of chaining ' \ '`%s...%s`.' def_node_matcher :chain_array_allocation?, <<~PATTERN diff --git a/lib/rubocop/cop/performance/collection_literal_in_loop.rb b/lib/rubocop/cop/performance/collection_literal_in_loop.rb index 5803594fa7..50b0bbc20f 100644 --- a/lib/rubocop/cop/performance/collection_literal_in_loop.rb +++ b/lib/rubocop/cop/performance/collection_literal_in_loop.rb @@ -32,7 +32,7 @@ module Performance # end # class CollectionLiteralInLoop < Base - MSG = 'Avoid immutable %s literals in loops. '\ + MSG = 'Avoid immutable %s literals in loops. ' \ 'It is better to extract it into a local variable or a constant.' POST_CONDITION_LOOP_TYPES = %i[while_post until_post].freeze diff --git a/lib/rubocop/cop/performance/inefficient_hash_search.rb b/lib/rubocop/cop/performance/inefficient_hash_search.rb index 3c354e3b99..dd38a94b20 100644 --- a/lib/rubocop/cop/performance/inefficient_hash_search.rb +++ b/lib/rubocop/cop/performance/inefficient_hash_search.rb @@ -58,8 +58,7 @@ def on_send(node) # `key?`/`value?` method. corrector.replace( node.loc.expression, - "#{autocorrect_hash_expression(node)}."\ - "#{autocorrect_method(node)}(#{autocorrect_argument(node)})" + "#{autocorrect_hash_expression(node)}.#{autocorrect_method(node)}(#{autocorrect_argument(node)})" ) end end @@ -68,8 +67,7 @@ def on_send(node) private def message(node) - "Use `##{autocorrect_method(node)}` instead of "\ - "`##{current_method(node)}.include?`." + "Use `##{autocorrect_method(node)}` instead of `##{current_method(node)}.include?`." end def autocorrect_method(node) diff --git a/spec/rubocop/cop/performance/constant_regexp_spec.rb b/spec/rubocop/cop/performance/constant_regexp_spec.rb index b1f6dd3442..6f187a0522 100644 --- a/spec/rubocop/cop/performance/constant_regexp_spec.rb +++ b/spec/rubocop/cop/performance/constant_regexp_spec.rb @@ -58,8 +58,7 @@ RUBY end - it 'does not register an offense when regexp contains interpolated constant and '\ - 'and interpolated non constant' do + it 'does not register an offense when regexp contains interpolated constant and and interpolated non constant' do expect_no_offenses(<<~RUBY) str.match?(/\#{CONST}\#{do_something(1)}/) RUBY diff --git a/spec/rubocop/cop/performance/redundant_match_spec.rb b/spec/rubocop/cop/performance/redundant_match_spec.rb index d2a658f240..72e4548504 100644 --- a/spec/rubocop/cop/performance/redundant_match_spec.rb +++ b/spec/rubocop/cop/performance/redundant_match_spec.rb @@ -85,8 +85,7 @@ def method(str) RUBY end - it 'does not register an error when return value of .match is returned from' \ - ' surrounding method' do + it 'does not register an error when return value of .match is returned from surrounding method' do expect_no_offenses(<<~RUBY) def method(str) str.match(/regex/)