diff --git a/CHANGELOG.md b/CHANGELOG.md index b892536a23..9e6546caf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ * [#451](https://github.com/rubocop/rubocop-rails/issues/451): Make `Rails/RelativeDateConstant` aware of `yesterday` and `tomorrow` methods. ([@koic][]) * [#454](https://github.com/rubocop/rubocop-rails/pull/454): Mark `Rails/WhereExists` as unsafe auto-correction. ([@koic][]) * [#456](https://github.com/rubocop/rubocop-rails/pull/456): Drop Ruby 2.4 support. ([@koic][]) +* [#462](https://github.com/rubocop/rubocop-rails/pull/462): Require RuboCop 1.7 or higher. ([@koic][]) ## 2.9.1 (2020-12-16) diff --git a/config/obsoletion.yml b/config/obsoletion.yml new file mode 100644 index 0000000000..9cfb451ff7 --- /dev/null +++ b/config/obsoletion.yml @@ -0,0 +1,7 @@ +# +# Configuration for obsoletion. +# +# See: https://docs.rubocop.org/rubocop/extensions.html#config-obsoletions +# +extracted: + Rails/*: ~ diff --git a/lib/rubocop/rails.rb b/lib/rubocop/rails.rb index fdc6d8b477..f94bb9658d 100644 --- a/lib/rubocop/rails.rb +++ b/lib/rubocop/rails.rb @@ -8,5 +8,7 @@ module Rails CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT) + + ::RuboCop::ConfigObsoletion.files << PROJECT_ROOT.join('config', 'obsoletion.yml') end end diff --git a/rubocop-rails.gemspec b/rubocop-rails.gemspec index 3eee62c466..46dde2aa86 100644 --- a/rubocop-rails.gemspec +++ b/rubocop-rails.gemspec @@ -35,5 +35,5 @@ Gem::Specification.new do |s| # Rack::Utils::SYMBOL_TO_STATUS_CODE, which is used by HttpStatus cop, was # introduced in rack 1.1 s.add_runtime_dependency 'rack', '>= 1.1' - s.add_runtime_dependency 'rubocop', '>= 0.90.0', '< 2.0' + s.add_runtime_dependency 'rubocop', '>= 1.7.0', '< 2.0' end diff --git a/spec/project_spec.rb b/spec/project_spec.rb index 719abfe9f0..59ab5cd056 100644 --- a/spec/project_spec.rb +++ b/spec/project_spec.rb @@ -4,10 +4,6 @@ describe 'default configuration file' do subject(:config) { RuboCop::ConfigLoader.load_file('config/default.yml') } - before do - allow_any_instance_of(RuboCop::Config).to receive(:loaded_features).and_return('rubocop-rails') # rubocop:disable RSpec/AnyInstance - end - let(:registry) { RuboCop::Cop::Registry.global } let(:cop_names) do registry.with_department(:Rails).cops.map(&:cop_name)