-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump RuboCop to 0.74.0 #1914
Bump RuboCop to 0.74.0 #1914
Conversation
* Rename `EnforcedStyle` of `Layout/IndentationConsistency` cop from `rails` to `indented_internal_methods` * Disable `Layout/SpaceAroundOperators` cop Refer rails/rails#36943
@koic I see that What do you think about setting a version number limit to |
To use the same minor version CodeClimate provided https://github.com/codeclimate/codeclimate-rubocop/blob/channel/rubocop-0-74/Gemfile.lock#L51-L55
@koic Nevermind. Let's use |
I guess it depends on codeclimate-rubocop's Gemfile.lock. The following detection is not supported until RuboCop Performance 1.4.1. % cd path/to/ocracle-enhanced
% bundle exec rubocop -a
Inspecting 66 files
...........C...................................C...C...C...C......
Offenses:
spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb:183:58: C: [Corrected] Performance/RegexpMatch: Use match? instead of match when MatchData is not used.
params[:database] = "/#{params[:database]}" unless params[:database].match(/^\//)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb:650:46: C: [Corrected] Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
field["data_default"] = nil if field["data_default"] =~ /^(null|empty_[bc]lob\(\))$/i
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb:68:21: C: [Corrected] Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
return if sql =~ /FROM all_/
^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb:321:35: C: [Corrected] Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
host = "[#{host}]" if host =~ /^[^\[].*:/ # IPv6
^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb:323:46: C: [Corrected] Performance/RegexpMatch: Use match? instead of match when MatchData is not used.
database = "/#{database}" unless database.match(/^\//)
^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb:241:26: C: [Corrected] Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
raise unless e.message =~ /^(Closed Connection|Io exception:|No more data to read from socket|IO Error:)/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 files inspected, 6 offenses detected, 6 offenses corrected You will be able to check the version of Code Climate if you leave the above code as it is and specify RuboCop Performance 1.4.1 in the Gemfile of this repo. Can you confirm it? |
Thanks for the answer. Yes, I have confirmed I'd like to use the same RuboCop and RuboCop Performance gem version which CodeClimate provides. Actually, I'd like to know if there is any way to run the latest versions of them but this is another topic. |
@koic I'd like to get your review to confirm that we are on the same page. |
Thanks for the confirm.
Yeah, the concern will be feedback to Code Climate's issue. |
Gemfile
Outdated
gem "rubocop", "~> 0.71.0", require: false | ||
gem "rubocop-performance", require: false | ||
gem "rubocop", "~> 0.74.0", require: false | ||
gem "rubocop-performance", "~> 1.3.0", require: false | ||
gem "rubocop-rails", require: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, It may be preferable to specify RuboCop Rails 2.0.0.
https://github.com/codeclimate/codeclimate-rubocop/blob/channel/rubocop-0-74/Gemfile.lock#L51-L55
Thanks for the review. Updated to lock Although I do not think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it. This change looks good to me.
Thanks again for the review. |
This pull request bumps RuboCop to 0.74.0 and uses the same
rubocop-performance
gem CodeClimate providedRename
EnforcedStyle
ofLayout/IndentationConsistency
copfrom
rails
toindented_internal_methods
Disable
Layout/SpaceAroundOperators
copRefer Bump RuboCop to 0.74.0 rails/rails#36943
Use rubocop-performance gem 1.3.x
Refer: https://github.com/codeclimate/codeclimate-rubocop/blob/channel/rubocop-0-74/Gemfile.lock#L51-L55