diff --git a/.rubocop.yml b/.rubocop.yml index 928bb17efe4..9c605a57fff 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,7 +12,7 @@ AllCops: - !ruby/regexp /(vendor|bundle|bin|db|tmp)\/.*/ DisplayCopNames: true DisplayStyleGuide: true - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 NewCops: enable Rails: @@ -271,6 +271,9 @@ Style/HashAsLastArrayItem: Style/HashLikeCase: Enabled: true +Style/HashSyntax: + EnforcedShorthandSyntax: either + Style/RedundantAssignment: Enabled: true diff --git a/app/jobs/notifier.rb b/app/jobs/notifier.rb index 2bd013c41ba..31eab05e9f0 100644 --- a/app/jobs/notifier.rb +++ b/app/jobs/notifier.rb @@ -29,7 +29,7 @@ def perform private - def timeout(sec, &block) - Timeout.timeout(sec, &block) + def timeout(sec, &) + Timeout.timeout(sec, &) end end diff --git a/test/functional/api/v1/rubygems_controller_test.rb b/test/functional/api/v1/rubygems_controller_test.rb index 2a741de0511..61e3847aa19 100644 --- a/test/functional/api/v1/rubygems_controller_test.rb +++ b/test/functional/api/v1/rubygems_controller_test.rb @@ -18,7 +18,7 @@ def self.should_respond_to_show end end - def self.should_respond_to(format, &block) + def self.should_respond_to(format, &) context "with #{format.to_s.upcase} for a hosted gem" do setup do @rubygem = create(:rubygem) @@ -26,7 +26,7 @@ def self.should_respond_to(format, &block) get :show, params: { id: @rubygem.to_param }, format: format end - should_respond_to_show(&block) + should_respond_to_show(&) end context "with #{format.to_s.upcase} for a hosted gem with a period in its name" do @@ -36,7 +36,7 @@ def self.should_respond_to(format, &block) get :show, params: { id: @rubygem.to_param }, format: format end - should_respond_to_show(&block) + should_respond_to_show(&) end context "with #{format.to_s.upcase} for a gem that doesn't match the slug" do @@ -46,7 +46,7 @@ def self.should_respond_to(format, &block) get :show, params: { id: "ZenTest" }, format: format end - should_respond_to_show(&block) + should_respond_to_show(&) end end diff --git a/test/helpers/gem_helpers.rb b/test/helpers/gem_helpers.rb index 435647f6652..7839ffac8a5 100644 --- a/test/helpers/gem_helpers.rb +++ b/test/helpers/gem_helpers.rb @@ -13,8 +13,8 @@ def build_gemspec(gemspec) end end - def build_gem(name, version, summary = "Gemcutter", platform = "ruby", &block) - build_gemspec(new_gemspec(name, version, summary, platform, &block)) + def build_gem(name, version, summary = "Gemcutter", platform = "ruby", &) + build_gemspec(new_gemspec(name, version, summary, platform, &)) end def new_gemspec(name, version, summary, platform, extra_args = {})