-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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.58.2 #33278
Bump RuboCop to 0.58.2 #33278
Conversation
r? @schneems (@rails-bot has picked a reviewer for you, use r? to override) |
|
d8d71fb
to
361740a
Compare
Thank you for the review. |
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.
The code change looks good after you revert the *args change.
However, looks like we now have 12 Code Climate issues. Do we need to disable a cop, or is there a way we can mitigate those?
# Prefer assert_not_x over refute_x | ||
CustomCops/RefuteNot: | ||
Rails: | ||
Enabled: true |
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.
We don't want to enable a whole category of checks here -- we should just enable the individual ones we want.
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.
AFAIK, the behavior of Rails
department is special.
Rails
department is disabled by default. And enabling Rails
department does not enable all Rails
cops. So only specified Rails
cops will be enabled. Here Rails/AssertNot
cop and Rails/RefuteMethods
cop are enabled.
The following is quoted from the official document.
https://github.com/rubocop-hq/rubocop/blob/v0.57.2/manual/configuration.md#enabled
The exception to the rule is the
Rails
department, which can not be enabled
in its entirety this way. SettingRails: Enabled: true
will have the same
effect as running with the--rails
command line option, which in the context
ofDisabledByDefault: true
means to make it possible to enable Rails cops
individually.AllCops: EnabledByDefault: true
This problem seems to have already been solved in
However, it seems that this problem is occurring, as it has not been released yet. I'm not sure why this problem started again in Code Climate. This is speculation, perhaps it may be occurring just after updating the rubocop-channel. What we can do is to ask for the release of |
361740a
to
ec5830e
Compare
RuboCop 0.58 has been released. And I will update this PR when Code Climate supports RuboCop 0.58. |
I think it already does codeclimate/codeclimate@v0.75.0...v0.76.0#diff-ec4308ace88ea5707ebbe98eec7de990R178 |
Upgrading was suspended due to the following regression up to RuboCop 0.58.1. % bundle exec rubocop actionview/test/template/form_helper/form_with_test.rb
Inspecting 1 file
C
Offenses:
actionview/test/template/form_helper/form_with_test.rb:453:9: C: Layout/IndentationWidth: Use 2 (not -2) spaces for indentation.
"That would be great."
^^
actionview/test/template/form_helper/form_with_test.rb:457:9: C: Layout/IndentationWidth: Use 2 (not -2) spaces for indentation.
"I believe you have my stapler."
^^
1 file inspected, 2 offenses detected RuboCop 0.58.2 containing rubocop/rubocop#6103 that fixes this has been released, so I will try the upgrade. Thank you. |
ec5830e
to
055cfc9
Compare
Unfortunately, it seems that the behavior of RuboCop in Code Climate is old. I think I will ask a question later to Code Climate. |
## Summary RuboCop 0.58.2 was released. https://github.com/rubocop-hq/rubocop/releases/tag/v0.58.2 And rubocop-0-58 channel is available in Code Climate. https://github.com/codeclimate/codeclimate/releases/tag/v0.76.0 codeclimate/codeclimate@38f21f0 In addition, the following changes are made in this PR. - Replace Custom cops with Rails cops - Add jaro_winkler gem to Gemfile.lock ### Replace Custom cops with Rails cops These are compatible replacements. - Replace `CustomCops/AssertNot` cop with `Rails/AssertNot` cop. - Replace `CustomCops/RefuteNot` cop with `Rails/RefuteMethods` cop. With this replacement, it was decided to use cop of RuboCop itself. It removes the code related to CustomCops accordingly. ### Add jaro_winkler gem to Gemfile.lock Since RuboCop 0.57.0 depends on jaro_winkler gem, it has been added to Gemfile.lock.
055cfc9
to
211b10a
Compare
RuboCop 0.58.2 is enabled with Code Climate and warning is zero 💚 |
Follow up of rails/rails#33278.
Summary
RuboCop 0.57.2 was released.
https://github.com/rubocop-hq/rubocop/releases/tag/v0.57.2
And rubocop-0-57 channel is available in Code Climate.
https://github.com/codeclimate/codeclimate/releases/tag/v0.75.0
In addition, the following changes are made in this PR.
Lint/Syntax
errorsReplace Custom cops with Rails cops
These are compatible replacements.
CustomCops/AssertNot
cop withRails/AssertNot
cop.CustomCops/RefuteNot
cop withRails/RefuteMethods
cop.With this replacement, it was decided to use cop of RuboCop itself. It removes the code related to CustomCops accordingly.
cc @composerinteralia
Add jaro_winkler gem to Gemfile.lock
Since RuboCop 0.57.0 depends on jaro_winkler gem, it has been added to Gemfile.lock.
Suppress
Lint/Syntax
errorsThere are several
Lint/Syntax
errors in the following code.Parentheses are added to prevent this error.
Below is a partial error log.