From 7e6b5c6be24adf6b97da79cadb48fe1b2b7f26a4 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 26 Feb 2019 21:45:04 +0100 Subject: [PATCH] chore: RuboCop Layout/ExtraSpacing --- .rubocop_todo.yml | 17 +++-------------- lib/faraday/adapter/net_http.rb | 2 +- lib/faraday/connection.rb | 2 +- test/adapters/test_middleware_test.rb | 2 +- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e49fd534c..2357501cd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-02-26 21:39:01 +0100 using RuboCop version 0.65.0. +# on 2019-02-27 07:46:41 +0100 using RuboCop version 0.65.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -15,15 +15,6 @@ Layout/EndAlignment: - 'lib/faraday/connection.rb' - 'test/helper.rb' -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. -Layout/ExtraSpacing: - Exclude: - - 'lib/faraday/adapter/net_http.rb' - - 'lib/faraday/connection.rb' - - 'test/adapters/test_middleware_test.rb' - # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. @@ -63,17 +54,15 @@ Layout/SpaceAroundEqualsInParameterDefault: Exclude: - 'lib/faraday/adapter/test.rb' -# Offense count: 12 +# Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment. Layout/SpaceAroundOperators: Exclude: - - 'lib/faraday/adapter/net_http.rb' - 'lib/faraday/request/retry.rb' - 'script/generate_certs' - 'spec/faraday/request/url_encoded_spec.rb' - 'spec/support/helper_methods.rb' - - 'test/adapters/test_middleware_test.rb' - 'test/shared.rb' # Offense count: 3 @@ -913,7 +902,7 @@ Style/YodaCondition: - 'script/proxy-server' - 'test/helper.rb' -# Offense count: 272 +# Offense count: 271 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: diff --git a/lib/faraday/adapter/net_http.rb b/lib/faraday/adapter/net_http.rb index 1fac6dfb5..8eac3ab35 100644 --- a/lib/faraday/adapter/net_http.rb +++ b/lib/faraday/adapter/net_http.rb @@ -161,7 +161,7 @@ def configure_request(http, req) http.open_timeout = req[:open_timeout] if req[:open_timeout] http.write_timeout = req[:write_timeout] if req[:write_timeout] && http.respond_to?(:write_timeout=) # Only set if Net::Http supports it, since Ruby 2.5. - http.max_retries = 0 if http.respond_to?(:max_retries=) + http.max_retries = 0 if http.respond_to?(:max_retries=) @config_block.call(http) if @config_block end diff --git a/lib/faraday/connection.rb b/lib/faraday/connection.rb index 80e55a647..a1d0dff8d 100644 --- a/lib/faraday/connection.rb +++ b/lib/faraday/connection.rb @@ -512,7 +512,7 @@ def build_exclusive_url(url = nil, params = nil, params_encoder = nil) base = url_prefix if url and base.path and base.path !~ /\/$/ base = base.dup - base.path = base.path + '/' # ensure trailing slash + base.path = base.path + '/' # ensure trailing slash end uri = url ? base + url : base uri.query = params.to_query(params_encoder || options.params_encoder) if params diff --git a/test/adapters/test_middleware_test.rb b/test/adapters/test_middleware_test.rb index 8b9264d17..91ff515b8 100644 --- a/test/adapters/test_middleware_test.rb +++ b/test/adapters/test_middleware_test.rb @@ -29,7 +29,7 @@ def setup [404, {'Content-Type' => 'text/html'}] end end - @conn = Faraday.new do |builder| + @conn = Faraday.new do |builder| builder.adapter :test, @stubs end @resp = @conn.get('/hello')