diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37fad8fb..fe36a3d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - ruby-version: [2.5, 2.6, 2.7, '3.0', 3.1] + ruby-version: [2.6, 2.7, '3.0', 3.1] runs-on: ${{ matrix.os }} diff --git a/.standard.yml b/.standard.yml index fb71e4d5..5d4a7077 100644 --- a/.standard.yml +++ b/.standard.yml @@ -1,4 +1,4 @@ -ruby_version: 2.2.0 +ruby_version: 2.6 ignore: - tmp/**/* - test/fixture/**/* diff --git a/lib/standard/creates_config_store/assigns_rubocop_yaml.rb b/lib/standard/creates_config_store/assigns_rubocop_yaml.rb index dc53bab9..f69b2ba8 100644 --- a/lib/standard/creates_config_store/assigns_rubocop_yaml.rb +++ b/lib/standard/creates_config_store/assigns_rubocop_yaml.rb @@ -4,7 +4,7 @@ class Standard::CreatesConfigStore class AssignsRubocopYaml def call(config_store, standard_config) config_store.options_config = rubocop_yaml_path(standard_config[:ruby_version]) - config_store.instance_variable_get("@options_config") + config_store.instance_variable_get(:@options_config) end private diff --git a/standard.gemspec b/standard.gemspec index f0316840..7197a792 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.5.0" + spec.required_ruby_version = ">= 2.6.0" spec.summary = "Ruby Style Guide, with linter & automatic code fixer" spec.homepage = "https://github.com/testdouble/standard" diff --git a/test/standard/builds_config_test.rb b/test/standard/builds_config_test.rb index b1e83cd6..531ad1ef 100644 --- a/test/standard/builds_config_test.rb +++ b/test/standard/builds_config_test.rb @@ -52,7 +52,7 @@ def test_decked_out_standard_yaml expected_config = RuboCop::ConfigStore.new.tap do |config_store| config_store.options_config = path("config/ruby-1.8.yml") - options_config = config_store.instance_variable_get("@options_config") + options_config = config_store.instance_variable_get(:@options_config) options_config["AllCops"]["Exclude"] |= [path("test/fixture/config/y/monkey/**/*")] options_config["Fake/Lol"] = {"Exclude" => [path("test/fixture/config/y/neat/cool.rb")]} options_config["Fake/Kek"] = {"Exclude" => [path("test/fixture/config/y/neat/cool.rb")]} @@ -131,7 +131,7 @@ def test_todo_with_offenses_merged def config_store(config_root = nil, rubocop_yml = highest_compatible_yml_version, ruby_version = RUBY_VERSION) RuboCop::ConfigStore.new.tap do |config_store| config_store.options_config = path(rubocop_yml) - options_config = config_store.instance_variable_get("@options_config") + options_config = config_store.instance_variable_get(:@options_config) options_config["AllCops"]["TargetRubyVersion"] = ruby_version.to_f options_config["AllCops"]["Exclude"] |= standard_default_ignores(config_root) end.for("").to_h diff --git a/test/standard_test.rb b/test/standard_test.rb index a2981e3a..248758ed 100644 --- a/test/standard_test.rb +++ b/test/standard_test.rb @@ -12,11 +12,11 @@ def test_configured_all_cops base = "config/base.yml" # see if everything is configured - allowed = Standard::BuildsConfig.new.call([]). - rubocop_config_store. - instance_variable_get(:@options_config). - instance_variable_get(:@hash). - keys + allowed = Standard::BuildsConfig.new.call([]) + .rubocop_config_store + .instance_variable_get(:@options_config) + .instance_variable_get(:@hash) + .keys configured = YAML.load_file(base).keys missing = (allowed - configured).grep(/\//) # ignore groups like "Layout" extra = (configured - allowed).grep(/\AA-Z/) # ignore "require" @@ -27,7 +27,7 @@ def test_configured_all_cops separator = "\n\n" sections = File.read(base).strip.split(separator) sections += missing.map { |key| "#{key}:\n Enabled: false" } - sections = sections.first(1) + sections[1..-1].sort # keep require in the front + sections = sections.first(1) + sections[1..].sort # keep require in the front File.write(base, sections.join(separator) + "\n") flunk "#{base} has been rewritten to add missing cops, review and commit it" end