Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: RuboCop lint Layout/AlignHash #863

Merged
merged 1 commit into from
Feb 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 0 additions & 15 deletions .rubocop_todo.yml
Expand Up @@ -6,21 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 25
# Cop supports --auto-correct.
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/AlignHash:
Exclude:
- 'lib/faraday/adapter/excon.rb'
- 'lib/faraday/adapter/httpclient.rb'
- 'lib/faraday/adapter/rack.rb'
- 'lib/faraday/autoload.rb'
- 'lib/faraday/request.rb'
- 'script/server'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
Expand Down
12 changes: 6 additions & 6 deletions lib/faraday/adapter/excon.rb
Expand Up @@ -38,11 +38,11 @@ def call(env)

if req[:proxy]
opts[:proxy] = {
:host => req[:proxy][:uri].host,
:host => req[:proxy][:uri].host,
:hostname => req[:proxy][:uri].hostname,
:port => req[:proxy][:uri].port,
:scheme => req[:proxy][:uri].scheme,
:user => req[:proxy][:user],
:port => req[:proxy][:uri].port,
:scheme => req[:proxy][:uri].scheme,
:user => req[:proxy][:user],
:password => req[:proxy][:password]
}
end
Expand All @@ -51,9 +51,9 @@ def call(env)
conn = create_connection(env, opts)

resp = conn.request \
:method => env[:method].to_s.upcase,
:method => env[:method].to_s.upcase,
:headers => env[:request_headers],
:body => read_body(env)
:body => read_body(env)

if req.stream_response?
warn "Streaming downloads for #{self.class.name} are not yet implemented."
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/adapter/httpclient.rb
Expand Up @@ -38,7 +38,7 @@ def call(env)
env[:body] = env[:body].read if env[:body].respond_to? :read

resp = client.request env[:method], env[:url],
:body => env[:body],
:body => env[:body],
:header => env[:request_headers]

if (req = env[:request]).stream_response?
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/adapter/rack.rb
Expand Up @@ -29,7 +29,7 @@ def call(env)
super
rack_env = {
:method => env[:method],
:input => env[:body].respond_to?(:read) ? env[:body].read : env[:body],
:input => env[:body].respond_to?(:read) ? env[:body].read : env[:body],
'rack.url_scheme' => env[:url].scheme
}

Expand Down
20 changes: 10 additions & 10 deletions lib/faraday/autoload.rb
Expand Up @@ -53,16 +53,16 @@ def all_loaded_constants
class Adapter
extend AutoloadHelper
autoload_all 'faraday/adapter',
:NetHttp => 'net_http',
:NetHttp => 'net_http',
:NetHttpPersistent => 'net_http_persistent',
:EMSynchrony => 'em_synchrony',
:EMHttp => 'em_http',
:Typhoeus => 'typhoeus',
:Patron => 'patron',
:Excon => 'excon',
:Test => 'test',
:Rack => 'rack',
:HTTPClient => 'httpclient'
:EMSynchrony => 'em_synchrony',
:EMHttp => 'em_http',
:Typhoeus => 'typhoeus',
:Patron => 'patron',
:Excon => 'excon',
:Test => 'test',
:Rack => 'rack',
:HTTPClient => 'httpclient'
end

class Request
Expand All @@ -81,6 +81,6 @@ class Response
extend AutoloadHelper
autoload_all 'faraday/response',
:RaiseError => 'raise_error',
:Logger => 'logger'
:Logger => 'logger'
end
end
8 changes: 4 additions & 4 deletions lib/faraday/request.rb
Expand Up @@ -104,11 +104,11 @@ def []=(key, value)
# @return [Hash] the hash ready to be serialized in Marshal.
def marshal_dump
{
:method => method,
:body => body,
:method => method,
:body => body,
:headers => headers,
:path => path,
:params => params,
:path => path,
:params => params,
:options => options
}
end
Expand Down
6 changes: 3 additions & 3 deletions script/server
Expand Up @@ -24,9 +24,9 @@ if ENV['SSL_KEY']
require 'openssl'
require 'webrick/https'
webrick_opts.update \
:SSLEnable => true,
:SSLPrivateKey => OpenSSL::PKey::RSA.new(File.read(ENV['SSL_KEY'])),
:SSLCertificate => OpenSSL::X509::Certificate.new(File.read(ENV['SSL_FILE'])),
:SSLEnable => true,
:SSLPrivateKey => OpenSSL::PKey::RSA.new(File.read(ENV['SSL_KEY'])),
:SSLCertificate => OpenSSL::X509::Certificate.new(File.read(ENV['SSL_FILE'])),
:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE
end

Expand Down