diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2cac9d0..c511ee5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Ruby 2.6 + - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 with: - ruby-version: '2.6' + ruby-version: '2.7' bundler-cache: true - name: Run linter diff --git a/.rubocop.yml b/.rubocop.yml index 7dc3c73..b86fdcc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,7 +7,7 @@ inherit_mode: - Exclude AllCops: - TargetRubyVersion: 2.6 + TargetRubyVersion: 2.7 # for checking cops with interpolation Lint/InterpolationCheck: diff --git a/CHANGELOG.md b/CHANGELOG.md index 643cd26..7e560e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ The format is described in [Contributing notes](CONTRIBUTING.md#changelog-entry- ## master +## 1.5.0 + +* **(Breaking)** Support Ruby >= 2.7.0 + +* Update rubocop to `1.55.1`. ([@Set27]) +* Update rubocop-rails to `2.20.2`. ([@Set27]) +* Update rubocop-spec to `2.23.0`. ([@Set27]) + ## 1.4.0 (2023-02-11) ### Changed diff --git a/Gemfile b/Gemfile index 2f12535..cbf595e 100644 --- a/Gemfile +++ b/Gemfile @@ -8,4 +8,4 @@ gemspec gem "pry-byebug" gem "rake", "~> 13.0" -gem "rspec", "~> 3.10" +gem "rspec", "~> 3.12.0" diff --git a/datarockets-style.gemspec b/datarockets-style.gemspec index bbda1f9..34ea2b3 100644 --- a/datarockets-style.gemspec +++ b/datarockets-style.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |spec| spec.homepage = "https://github.com/datarockets/datarockets-style" spec.license = "MIT" - spec.required_ruby_version = ">= 2.6.0" + spec.required_ruby_version = ">= 2.7.0" # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. @@ -32,9 +32,9 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "rubocop", "~> 1.45.1" - spec.add_dependency "rubocop-rails", "~> 2.17.4" - spec.add_dependency "rubocop-rspec", "~> 2.18.1" + spec.add_dependency "rubocop", "~> 1.55.1" + spec.add_dependency "rubocop-rails", "~> 2.20.2" + spec.add_dependency "rubocop-rspec", "~> 2.23.0" spec.metadata["rubygems_mfa_required"] = "true" end diff --git a/lib/datarockets_style/formatter/todo_list_formatter.rb b/lib/datarockets_style/formatter/todo_list_formatter.rb index 4bb1e4d..abaf448 100644 --- a/lib/datarockets_style/formatter/todo_list_formatter.rb +++ b/lib/datarockets_style/formatter/todo_list_formatter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "pathname" -require_relative "./todo_list_formatter/report_summary" +require_relative "todo_list_formatter/report_summary" # This formatter works like default formattter (display dots for files with no offenses and # letters for files with problems in the them). diff --git a/spec/datarockets_style/cop/rspec/prefer_before_over_setup_spec.rb b/spec/datarockets_style/cop/rspec/prefer_before_over_setup_spec.rb index 9030b41..7b9fb3f 100644 --- a/spec/datarockets_style/cop/rspec/prefer_before_over_setup_spec.rb +++ b/spec/datarockets_style/cop/rspec/prefer_before_over_setup_spec.rb @@ -15,7 +15,7 @@ it "registers an offence on setup call" do expect_offense <<~RUBY setup do - ^^^^^^^^ Use `before` instead of `setup`. + ^^^^^^^^ RSpec/PreferBeforeOverSetup: Use `before` instead of `setup`. allow(post).to receive(:publish!) end RUBY @@ -34,7 +34,7 @@ it "registers an offence on setup call" do expect_offense <<~RUBY setup { - ^^^^^^^ Use `before` instead of `setup`. + ^^^^^^^ RSpec/PreferBeforeOverSetup: Use `before` instead of `setup`. allow(post).to receive(:publish!) } RUBY diff --git a/spec/datarockets_style/cop/style/nested_interpolation_spec.rb b/spec/datarockets_style/cop/style/nested_interpolation_spec.rb index e04eb3c..31d4c44 100644 --- a/spec/datarockets_style/cop/style/nested_interpolation_spec.rb +++ b/spec/datarockets_style/cop/style/nested_interpolation_spec.rb @@ -18,35 +18,35 @@ it "registers interpolation into business block" do expect_offense(<<~'RUBY') "#{assignment.join("\n#{indentation(node)}")}" - ^^^^^^^^^^^^^^^^^^^^ Redundant nested interpolation. + ^^^^^^^^^^^^^^^^^^^^ Style/NestedInterpolation: Redundant nested interpolation. RUBY end it 'registers an offense for "Hello, #{user.blank? ? guest : "dear #{user.name}"}"' do expect_offense(<<~'RUBY') "Hello, #{user.blank? ? 'guest' : "dear #{user.name}"}" - ^^^^^^^^^^^^ Redundant nested interpolation. + ^^^^^^^^^^^^ Style/NestedInterpolation: Redundant nested interpolation. RUBY end it 'registers an offense for %|Hello, #{user.blank? ? guest : "dear #{user.name}"|' do expect_offense(<<~'RUBY') %|Hello, #{user.blank? ? 'guest' : "dear #{user.name}"}| - ^^^^^^^^^^^^ Redundant nested interpolation. + ^^^^^^^^^^^^ Style/NestedInterpolation: Redundant nested interpolation. RUBY end it 'registers an offense for %Q(Hello, #{user.blank? ? guest : "dear #{user.name}")' do expect_offense(<<~'RUBY') %Q(Hello, #{user.blank? ? 'guest' : "dear #{user.name}"}) - ^^^^^^^^^^^^ Redundant nested interpolation. + ^^^^^^^^^^^^ Style/NestedInterpolation: Redundant nested interpolation. RUBY end it 'registers an offense for ["Hello, #{user.blank? ? guest : "dear #{user.name}"}"]' do expect_offense(<<~'RUBY') ["Hello, #{user.blank? ? 'guest' : "dear #{user.name}"}", 'foo'] - ^^^^^^^^^^^^ Redundant nested interpolation. + ^^^^^^^^^^^^ Style/NestedInterpolation: Redundant nested interpolation. RUBY end end diff --git a/spec/rubocop_examples/cop/layout/array_alignment_extended_spec.rb b/spec/rubocop_examples/cop/layout/array_alignment_extended_spec.rb index 76cd503..3b79d14 100644 --- a/spec/rubocop_examples/cop/layout/array_alignment_extended_spec.rb +++ b/spec/rubocop_examples/cop/layout/array_alignment_extended_spec.rb @@ -2,7 +2,7 @@ module RubocopExamples module Cop - module Lauout + module Layout class ArrayAlignmentExtended attr_reader :a, :b, :c @@ -20,10 +20,7 @@ def test2 def test3 it "returns himself and his investor" do - is_expected.to match_array([ - unaffiliated_investor, - broker_investor, - ]) + is_expected.to contain_exactly(unaffiliated_investor, broker_investor) end end end