Skip to content

Commit

Permalink
Drop Ruby 2.4 support 💎 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny authored Mar 10, 2024
1 parent 6cdb308 commit 099053e
Show file tree
Hide file tree
Showing 8 changed files with 439 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
bundler-cache: true

- name: RuboCop
run: bin/rubocop --format github
run: bin/rubocop-gradual --check
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ AllCops:
- bin/rake
- bin/rspec
- bin/rubocop
- bin/rubocop-gradual
- vendor/**/*

# Bundler
Expand Down
307 changes: 307 additions & 0 deletions .rubocop_gradual.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## unreleased

Changes:
- Drop support for Ruby before 2.7 (#126)

Fixes:
- Add default message to missing `message` key on advanced `input` or `output`
checks (#117)
Expand Down
19 changes: 0 additions & 19 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,3 @@
source "https://rubygems.org"

gemspec

if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5")
# Here because v1.13 requires ruby version >= 2.5.
gem "rubocop", "< 1.13"

# Here because v1.11.0 requires ruby version >= 2.5.
gem "rubocop-performance", "< 1.11.0"

# Here because v2.3.0 requires ruby version >= 2.5.
gem "rubocop-rspec", "< 2.3.0"

# RuboCop dependency
# Here because v1.21.0 requires ruby version >= 2.5.
gem "parallel", "< 1.21"

# RuboCop dependency
# Here because v1.4.2 requires ruby version >= 2.5.
gem "rubocop-ast", "< 1.4.2"
end
129 changes: 89 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,74 +8,123 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
code-scanning-rubocop (0.6.1)
rubocop (~> 1.0)
coderay (1.1.3)
diff-lcs (1.5.0)
diff-lcs (1.5.1)
diffy (3.4.2)
interactor (3.1.2)
json (2.7.1)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
method_source (1.0.0)
parallel (1.23.0)
parser (3.2.2.3)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.7.1)
racc (1.7.3)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.1)
rexml (3.2.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.1)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
rake (13.1.0)
regexp_parser (2.9.0)
rexml (3.2.6)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-block_is_expected (1.0.5)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.3)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (1.12.1)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.2.0, < 2.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.29.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-lts (12.0.1)
rubocop-ruby2_4 (~> 1.0.3)
rubocop-performance (1.16.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rake (0.6.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-gradual (0.3.4)
diff-lcs (>= 1.2.0, < 2.0)
diffy (~> 3.0)
parallel (~> 1.10)
rainbow (>= 2.2.2, < 4.0)
rubocop (~> 1.0)
rubocop-rspec (2.4.0)
rubocop-lts (18.2.1)
rubocop-ruby2_7 (>= 2.0.4, < 3)
standard-rubocop-lts (>= 1.0.3, < 3)
version_gem (>= 1.1.2, < 3)
rubocop-md (1.2.2)
rubocop (>= 1.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
rubocop-ruby2_4 (1.0.3)
rubocop (= 1.12.1)
rubocop-rspec (2.26.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-ruby2_7 (2.0.6)
rubocop-gradual (~> 0.3, >= 0.3.1)
rubocop-md (~> 1.2)
rubocop-rake (~> 0.6)
rubocop-shopify (~> 2.14)
rubocop-thread_safety (~> 0.5, >= 0.5.1)
standard-rubocop-lts (~> 1.0, >= 1.0.7)
version_gem (>= 1.1.3, < 3)
rubocop-shopify (2.15.1)
rubocop (~> 1.51)
rubocop-thread_safety (0.5.1)
rubocop (>= 0.90.0)
ruby-progressbar (1.13.0)
unicode-display_width (2.4.2)
zeitwerk (2.6.8)
standard (1.34.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.60)
standard-custom (~> 1.0.0)
standard-performance (~> 1.3)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.3.1)
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.2)
standard-rubocop-lts (1.0.9)
standard (>= 1.31.1, < 2)
standard-custom (>= 1.0.1, < 2)
standard-performance (>= 1.2, < 2)
version_gem (>= 1.1.3, < 4)
unicode-display_width (2.5.0)
version_gem (1.1.3)
zeitwerk (2.6.13)

PLATFORMS
ruby

DEPENDENCIES
code-scanning-rubocop
interactor
pry
rake
rspec
rubocop-lts (~> 12.0, >= 12.0.1)
rspec-block_is_expected (>= 1.0)
rubocop-gradual (>= 0.3)
rubocop-lts (~> 18.2)
rubocop-performance
rubocop-rake
rubocop-rspec
Expand Down
27 changes: 27 additions & 0 deletions bin/rubocop-gradual
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rubocop-gradual' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rubocop-gradual", "rubocop-gradual")
18 changes: 11 additions & 7 deletions service_actor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
`git ls-files -z lib`.split("\x0")
end

spec.required_ruby_version = [">= 2.4"]
spec.required_ruby_version = [">= 2.7"]

# Loader
spec.add_runtime_dependency "zeitwerk"
Expand All @@ -46,10 +46,17 @@ Gem::Specification.new do |spec|
# Debugger
spec.add_development_dependency "pry"

# Linting rubocop-lts v12 is a rubocop wrapper for Ruby >= 2.4,
# Linting rubocop-lts is a RuboCop wrapper for Ruby
# and should only be bumped when dropping old Ruby support
# see: https://dev.to/pboling/rubocop-lts-1e31
spec.add_development_dependency "rubocop-lts", ["~> 12.0", ">= 12.0.1"]
# see: https://rubocop-lts.gitlab.io/HOW_TO_UPGRADE_RUBY/
spec.add_development_dependency "rubocop-lts", "~> 18.2"

# rubocop-lts dependency. Can be removed when RuboCop LTS is upgraded.
# https://github.com/sunny/actor/pull/126#issuecomment-1966682674
spec.add_development_dependency "rspec-block_is_expected", ">= 1.0"

# Update RuboCop rules gradually.
spec.add_development_dependency "rubocop-gradual", ">= 0.3"

# Lint RSpec code
spec.add_development_dependency "rubocop-rspec"
Expand All @@ -60,9 +67,6 @@ Gem::Specification.new do |spec|
# Add Rakefile linting
spec.add_development_dependency "rubocop-rake"

# Formatter for GitHub’s code scanning
spec.add_development_dependency "code-scanning-rubocop"

# For testing Interactor migration support
spec.add_development_dependency "interactor"
end

0 comments on commit 099053e

Please sign in to comment.