diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 542c986b..bf0ae5ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,7 @@ jobs: matrix: os: [ubuntu-latest] ruby-version: + - '3.0' - '3.1' - '3.2' - '3.3' diff --git a/config/default.yml b/config/default.yml index 46d32ff8..b5efdd32 100644 --- a/config/default.yml +++ b/config/default.yml @@ -1,6 +1,6 @@ AllCops: - # Prevent RuboCop from exploding when it finds an older-than-2.6 .ruby-version - TargetRubyVersion: 2.6 + # Prevent RuboCop from exploding when it finds an older .ruby-version + TargetRubyVersion: 3.0 Exclude: [] DisabledByDefault: true StyleGuideBaseURL: https://github.com/standardrb/standard diff --git a/config/ruby-3.2.yml b/config/ruby-3.2.yml index 4c6b021a..35893bdc 100644 --- a/config/ruby-3.2.yml +++ b/config/ruby-3.2.yml @@ -1,4 +1,4 @@ -inherit_from: ./base.yml +inherit_from: ./ruby-3.3.yml AllCops: TargetRubyVersion: 3.2 diff --git a/config/ruby-3.3.yml b/config/ruby-3.3.yml new file mode 100644 index 00000000..cfbf600e --- /dev/null +++ b/config/ruby-3.3.yml @@ -0,0 +1,4 @@ +inherit_from: ./base.yml + +AllCops: + TargetRubyVersion: 3.3 diff --git a/lib/standard/base/plugin.rb b/lib/standard/base/plugin.rb index a092d982..3d0c4b63 100644 --- a/lib/standard/base/plugin.rb +++ b/lib/standard/base/plugin.rb @@ -57,6 +57,8 @@ def determine_yaml_path(desired_version) "ruby-3.1.yml" elsif desired_version < Gem::Version.new("3.3") "ruby-3.2.yml" + elsif desired_version < Gem::Version.new("3.4") + "ruby-3.3.yml" else default end diff --git a/standard.gemspec b/standard.gemspec index 93451e31..0a8ec863 100644 --- a/standard.gemspec +++ b/standard.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |spec| spec.version = Standard::VERSION spec.authors = ["Justin Searls"] spec.email = ["searls@gmail.com"] - spec.required_ruby_version = ">= 2.6.0" + spec.required_ruby_version = ">= 3.0.0" spec.summary = "Ruby Style Guide, with linter & automatic code fixer" spec.homepage = "https://github.com/standardrb/standard" diff --git a/test/standard/base/plugin_test.rb b/test/standard/base/plugin_test.rb index 43a5b918..2a9f0754 100644 --- a/test/standard/base/plugin_test.rb +++ b/test/standard/base/plugin_test.rb @@ -8,7 +8,8 @@ def setup end def test_paths - assert_match "base.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: "3.3.0")).value.to_s + assert_match "base.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: "3.4.0")).value.to_s + assert_match "ruby-3.3.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: "3.3.3")).value.to_s assert_match "ruby-3.2.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: "3.2.1")).value.to_s assert_match "ruby-2.7.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: Gem::Version.new("2.8.2"))).value.to_s assert_match "ruby-1.9.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: Gem::Version.new("1.9.3"))).value.to_s