Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Summary This PR warns for Performance Cops. The following warning is displayed when the next released rubocop gem is installed. ```console # The following is an example for operation check. % rake build % gem install pkg/rubocop-0.66.0.gem Performance Cops will be removed from RuboCop 0.68. Use rubocop-performance gem instead. Put this in your Gemfile. gem 'rubocop-performance' And then execute: $ bundle install Put this into your .rubocop.yml. require: rubocop-performance More information: https://github.com/rubocop-hq/rubocop-performance Successfully installed rubocop-0.66.0 1 gem installed ``` The following warning is displayed if RuboCop is used with Bundler. ```consle % bundle exec rubocop [Warn] Performance Cops will be removed from RuboCop 0.68. Use rubocop-performance gem instead. https://github.com/rubocop-hq/rubocop/tree/master/manual/migrate_performance_cops.md ``` The above warning will disappear when rubocop-performance gem is written to Gemfile. The rubocop-performance implementation takes precedence when rubocop-performance is written in Gemfile. And I prepared a simple migration manual (migrate_performance_cops.md) because I think that long warning sentences are not preferred. I think that referring to the link is good when runnning rubocop command. ### Other Infromation At first I tried to remove performance cops from RuboCop Core and add rubocop-performance gem as a dependency because of fallback. ```diff % git diff diff --git a/rubocop.gemspec b/rubocop.gemspec index bbbcca33f..09882b063 100644 --- a/rubocop.gemspec +++ b/rubocop.gemspec @@ -38,6 +38,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency('parser', '>= 2.5', '!= 2.5.1.1') s.add_runtime_dependency('psych', '>= 3.1.0') s.add_runtime_dependency('rainbow', '>= 2.2.2', '< 4.0') + s.add_runtime_dependency('rubocop-performance') s.add_runtime_dependency('ruby-progressbar', '~> 1.7') s.add_runtime_dependency('unicode-display_width', '>= 1.4.0', '< 1.6') ``` However, this cannot be resolved because it is cyclic. ```console % bundle install Fetching gem metadata from https://rubygems.org/........ Fetching gem metadata from https://rubygems.org/. Resolving dependencies... Your bundle requires gems that depend on each other, creating an infinite loop. Please remove either gem 'rubocop' or gem 'rubocop-performance' and try again. ``` So I'd like to display a warning before removing performance cops. I'd like to mitigate the impact on users this way. The next step is to remove performance cops and done #5977.
- Loading branch information
This breaks rubocop when using
bundler < 1.15
. See: #6917