Skip to content

Commit

Permalink
Merge pull request #3139 from tnir/tnir-TargetRubyVersion-3.1-in-rubocop
Browse files Browse the repository at this point in the history
Set TargetRubyVersion: 3.1 for RuboCop
  • Loading branch information
jenshenny authored Jul 13, 2022
2 parents 1c95151 + 9947445 commit 25f0f67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -271,6 +271,9 @@ Style/HashAsLastArrayItem:
Style/HashLikeCase:
Enabled: true

Style/HashSyntax:
EnforcedShorthandSyntax: either

Style/RedundantAssignment:
Enabled: true

Expand Down
4 changes: 2 additions & 2 deletions app/jobs/notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def perform

private

def timeout(sec, &block)
Timeout.timeout(sec, &block)
def timeout(sec, &)
Timeout.timeout(sec, &)
end
end
8 changes: 4 additions & 4 deletions test/functional/api/v1/rubygems_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ 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)
create(:version, rubygem: @rubygem)
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
Expand All @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/helpers/gem_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down

0 comments on commit 25f0f67

Please sign in to comment.