From 04d40b74c48cf3f255d637e45ee5d73d400c75d7 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 25 Oct 2020 15:24:19 +0900 Subject: [PATCH] Enable `Layout/SpaceAroundOperators` cop Follow https://github.com/rails/rails/pull/40436. This PR enables `Layout/SpaceAroundOperators` cop. https://github.com/rails/rails/pull/40436 setting requires RuboCop 1.0 and RuboCop AST 1.0.1 or higher. https://github.com/rubocop-hq/rubocop/issues/8919 Therefore this PR will be dropping versions that is lack for that requires. --- .github/workflows/test.yml | 5 ----- Appraisals | 2 +- config/rails.yml | 3 +++ gemfiles/rubocop_0.89.gemfile | 14 -------------- gemfiles/rubocop_0.90.gemfile | 14 -------------- gemfiles/rubocop_0.91.gemfile | 14 -------------- gemfiles/rubocop_0.92.gemfile | 14 -------------- gemfiles/rubocop_0.93.gemfile | 14 -------------- rubocop-rails_config.gemspec | 3 ++- 9 files changed, 6 insertions(+), 77 deletions(-) delete mode 100644 gemfiles/rubocop_0.89.gemfile delete mode 100644 gemfiles/rubocop_0.90.gemfile delete mode 100644 gemfiles/rubocop_0.91.gemfile delete mode 100644 gemfiles/rubocop_0.92.gemfile delete mode 100644 gemfiles/rubocop_0.93.gemfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fdacf3d..2862787 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,11 +6,6 @@ jobs: matrix: ruby: [2.4, 2.5, 2.6, 2.7] gemfile: - - gemfiles/rubocop_0.89.gemfile - - gemfiles/rubocop_0.90.gemfile - - gemfiles/rubocop_0.91.gemfile - - gemfiles/rubocop_0.92.gemfile - - gemfiles/rubocop_0.93.gemfile - gemfiles/rubocop_1.0.gemfile env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} diff --git a/Appraisals b/Appraisals index 6a72cee..102a8e5 100644 --- a/Appraisals +++ b/Appraisals @@ -1,6 +1,6 @@ # frozen_string_literal: true -SUPPORTED_VERSIONS = %w[0.89 0.90 0.91 0.92 0.93 1.0].freeze +SUPPORTED_VERSIONS = %w[1.0].freeze SUPPORTED_VERSIONS.each do |version| appraise "rubocop-#{version}" do diff --git a/config/rails.yml b/config/rails.yml index 9886909..1437b55 100644 --- a/config/rails.yml +++ b/config/rails.yml @@ -124,6 +124,9 @@ Layout/SpaceAroundEqualsInParameterDefault: Layout/SpaceAroundKeyword: Enabled: true +Layout/SpaceAroundOperators: + Enabled: true + Layout/SpaceBeforeComma: Enabled: true diff --git a/gemfiles/rubocop_0.89.gemfile b/gemfiles/rubocop_0.89.gemfile deleted file mode 100644 index 2038906..0000000 --- a/gemfiles/rubocop_0.89.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "bundler" -gem "minitest" -gem "rake" -gem "rails", ">= 5.0" -gem "rubocop", "~> 0.89.0" - -gemspec path: "../" diff --git a/gemfiles/rubocop_0.90.gemfile b/gemfiles/rubocop_0.90.gemfile deleted file mode 100644 index 0e57274..0000000 --- a/gemfiles/rubocop_0.90.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "bundler" -gem "minitest" -gem "rake" -gem "rails", ">= 5.0" -gem "rubocop", "~> 0.90.0" - -gemspec path: "../" diff --git a/gemfiles/rubocop_0.91.gemfile b/gemfiles/rubocop_0.91.gemfile deleted file mode 100644 index 6c1af4c..0000000 --- a/gemfiles/rubocop_0.91.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "bundler" -gem "minitest" -gem "rake" -gem "rails", ">= 5.0" -gem "rubocop", "~> 0.91.0" - -gemspec path: "../" diff --git a/gemfiles/rubocop_0.92.gemfile b/gemfiles/rubocop_0.92.gemfile deleted file mode 100644 index 73ee0ff..0000000 --- a/gemfiles/rubocop_0.92.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "bundler" -gem "minitest" -gem "rake" -gem "rails", ">= 5.0" -gem "rubocop", "~> 0.92.0" - -gemspec path: "../" diff --git a/gemfiles/rubocop_0.93.gemfile b/gemfiles/rubocop_0.93.gemfile deleted file mode 100644 index c6c346a..0000000 --- a/gemfiles/rubocop_0.93.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "bundler" -gem "minitest" -gem "rake" -gem "rails", ">= 5.0" -gem "rubocop", "~> 0.93.0" - -gemspec path: "../" diff --git a/rubocop-rails_config.gemspec b/rubocop-rails_config.gemspec index 860acfb..939feaf 100644 --- a/rubocop-rails_config.gemspec +++ b/rubocop-rails_config.gemspec @@ -12,7 +12,8 @@ Gem::Specification.new do |spec| spec.license = "MIT" spec.required_ruby_version = ">= 2.4.0" - spec.add_dependency "rubocop", ">= 0.89" + spec.add_dependency "rubocop", ">= 1.0" + spec.add_dependency "rubocop-ast", ">= 1.0.1" spec.add_dependency "rubocop-performance", "~> 1.3" spec.add_dependency "rubocop-rails", "~> 2.0" spec.add_dependency "rubocop-packaging", "~> 0.4"