diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 04622bb1..f4c45d40 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -175,17 +175,6 @@ Style/NumericPredicate: - 'lib/faraday/upload_io.rb' - 'lib/faraday/utils/headers.rb' -# Offense count: 7 -# Cop supports --auto-correct. -Style/ParallelAssignment: - Exclude: - - 'lib/faraday/rack_builder.rb' - - 'script/server' - - 'spec/support/helper_methods.rb' - - 'spec/support/shared_examples/request_method.rb' - - 'test/adapters/integration.rb' - - 'test/helper.rb' - # Offense count: 278 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https diff --git a/lib/faraday/rack_builder.rb b/lib/faraday/rack_builder.rb index 7a3c49ca..368eb13a 100644 --- a/lib/faraday/rack_builder.rb +++ b/lib/faraday/rack_builder.rb @@ -33,7 +33,8 @@ module Faraday if klass.respond_to?(:name) @@constants_mutex.synchronize { @@constants[@name] = klass } end - @args, @block = args, block + @args = args + @block = block end def klass diff --git a/script/server b/script/server index 2dc30639..1105c629 100755 --- a/script/server +++ b/script/server @@ -1,7 +1,8 @@ #!/usr/bin/env ruby # frozen_string_literal: true -old_verbose, $VERBOSE = $VERBOSE, nil +old_verbose = $VERBOSE +$VERBOSE = nil begin require File.expand_path('../test/live_server', __dir__) ensure diff --git a/spec/support/helper_methods.rb b/spec/support/helper_methods.rb index 8f5e6b98..6560d686 100644 --- a/spec/support/helper_methods.rb +++ b/spec/support/helper_methods.rb @@ -74,7 +74,8 @@ module Faraday end def capture_warnings - old, $stderr = $stderr, StringIO.new + old = $stderr + $stderr = StringIO.new begin yield $stderr.string diff --git a/spec/support/shared_examples/request_method.rb b/spec/support/shared_examples/request_method.rb index 474d9132..3bfe96cf 100644 --- a/spec/support/shared_examples/request_method.rb +++ b/spec/support/shared_examples/request_method.rb @@ -161,7 +161,8 @@ shared_examples 'a request method' do |http_method| on_feature :parallel do it 'handles parallel requests' do - resp1, resp2 = nil, nil + resp1 = nil + resp2 = nil payload1 = { a: '1' } payload2 = { b: '2' } request_stub.with(Hash[query_or_body, payload1]) diff --git a/test/adapters/integration.rb b/test/adapters/integration.rb index 27b7ef73..f62e1e54 100644 --- a/test/adapters/integration.rb +++ b/test/adapters/integration.rb @@ -44,8 +44,10 @@ module Adapters module ParallelNonStreaming def test_callback_is_called_in_parallel_with_no_streaming_support - resp1, resp2 = nil, nil - streamed1, streamed2 = nil, nil + resp1 = nil + resp2 = nil + streamed1 = nil + streamed2 = nil connection = create_connection err = capture_warnings do diff --git a/test/helper.rb b/test/helper.rb index a0811007..bde809d6 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -49,7 +49,8 @@ module Faraday end unless defined? ::MiniTest def capture_warnings - old, $stderr = $stderr, StringIO.new + old = $stderr + $stderr = StringIO.new begin yield $stderr.string