diff --git a/.rubocop.yml b/.rubocop.yml index 1a611a71b4..72ef1925e3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,6 @@ inherit_from: .rubocop-bundler.yml - +require: + - rubocop-performance AllCops: Exclude: - bin/**/* diff --git a/gemstash.gemspec b/gemstash.gemspec index 562e0d66e6..c4e428676a 100644 --- a/gemstash.gemspec +++ b/gemstash.gemspec @@ -59,5 +59,6 @@ you push your own private gems as well." spec.add_development_dependency "rack-test", "~> 1.1" spec.add_development_dependency "rake", "~> 12.3" spec.add_development_dependency "rspec", "~> 3.3" - spec.add_development_dependency "rubocop", "= 0.67.2" + spec.add_development_dependency "rubocop", "= 0.68.1" + spec.add_development_dependency "rubocop-performance", "~> 1.1" end diff --git a/lib/gemstash/gem_source.rb b/lib/gemstash/gem_source.rb index c7d626c860..b4524b265e 100644 --- a/lib/gemstash/gem_source.rb +++ b/lib/gemstash/gem_source.rb @@ -29,7 +29,7 @@ class Base include Gemstash::Logging def_delegators :@app, :cache_control, :content_type, :env, :halt, - :headers, :http_client_for, :params, :redirect, :request + :headers, :http_client_for, :params, :redirect, :request def initialize(app) @app = app diff --git a/lib/gemstash/gem_source/upstream_source.rb b/lib/gemstash/gem_source/upstream_source.rb index 8d818f1e50..4caa9ea050 100644 --- a/lib/gemstash/gem_source/upstream_source.rb +++ b/lib/gemstash/gem_source/upstream_source.rb @@ -93,8 +93,10 @@ def serve_prerelease_specs private def upstream - @upstream ||= Gemstash::Upstream.new(env["gemstash.upstream"], - user_agent: env["gemstash.user-agent"]) + @upstream ||= Gemstash::Upstream.new( + env["gemstash.upstream"], + user_agent: env["gemstash.user-agent"] + ) end def index_upstream diff --git a/spec/gemstash/http_client_spec.rb b/spec/gemstash/http_client_spec.rb index 34d744b7a8..c1a45fcd7a 100644 --- a/spec/gemstash/http_client_spec.rb +++ b/spec/gemstash/http_client_spec.rb @@ -82,7 +82,7 @@ context "with a client that specifies a user agent" do let(:http_client) do Gemstash::HTTPClient.new(faraday_client, - user_agent: "my-agent 6.6.6") + user_agent: "my-agent 6.6.6") end it "forwards the user agent to the remote server" do diff --git a/spec/gemstash/upstream_spec.rb b/spec/gemstash/upstream_spec.rb index e396afa218..d13e357508 100644 --- a/spec/gemstash/upstream_spec.rb +++ b/spec/gemstash/upstream_spec.rb @@ -59,7 +59,7 @@ it "supports getting user agent" do expect(Gemstash::Upstream.new("https://rubygems.org/", - user_agent: "my_user_agent").user_agent).to eq("my_user_agent") + user_agent: "my_user_agent").user_agent).to eq("my_user_agent") end describe ".url" do