Skip to content

Commit

Permalink
Merge pull request #235 from koic/support_obsoletion_configuration
Browse files Browse the repository at this point in the history
Require RuboCop 1.7 or higher due to support obsoletion configuration
  • Loading branch information
koic authored Apr 21, 2021
2 parents 6c5c8e3 + a155366 commit 29da900
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

* [#228](https://github.com/rubocop/rubocop-performance/pull/228): Mark `Performance/RedundantMerge` as unsafe. ([@dvandersluis][])
* [#232](https://github.com/rubocop/rubocop-performance/pull/232): Drop Ruby 2.4 support. ([@koic][])
* [#235](https://github.com/rubocop/rubocop-performance/pull/235): Require RuboCop 1.7 or higher. ([@koic][])

## 1.10.2 (2021-03-23)

Expand Down
7 changes: 7 additions & 0 deletions config/obsoletion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Configuration for obsoletion.
#
# See: https://docs.rubocop.org/rubocop/extensions.html#config-obsoletions
#
extracted:
Performance/*: ~
2 changes: 2 additions & 0 deletions lib/rubocop/performance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ module Performance
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
2 changes: 1 addition & 1 deletion rubocop-performance.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Gem::Specification.new do |s|
'bug_tracker_uri' => 'https://github.com/rubocop/rubocop-performance/issues'
}

s.add_runtime_dependency('rubocop', '>= 0.90.0', '< 2.0')
s.add_runtime_dependency('rubocop', '>= 1.7.0', '< 2.0')
s.add_runtime_dependency('rubocop-ast', '>= 0.4.0')
end
4 changes: 0 additions & 4 deletions spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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-performance') # rubocop:disable RSpec/AnyInstance
end

let(:registry) { RuboCop::Cop::Registry.global }
let(:cop_names) do
registry.with_department(:Performance).cops.map(&:cop_name)
Expand Down

0 comments on commit 29da900

Please sign in to comment.