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
Update to rubocop 0.76 #163
Conversation
@@ -474,11 +472,6 @@ Layout/SpaceInsideBlockBraces: | |||
EnforcedStyleForEmptyBraces: no_space | |||
SpaceBeforeBlockParameters: true | |||
|
|||
Layout/SpaceInsideParens: |
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.
This was just duplicated elsewhere in the file! It still exists, but the newer rubocop doesn't allow duplicated styles it seems.
@@ -344,7 +343,6 @@ Layout/MultilineMethodCallIndentation: | |||
SupportedStyles: | |||
- aligned | |||
- indented | |||
IndentationWidth: |
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.
IndentationWidth
isn't supported anymore, although I can't find in the rubocop changelog where exactly that happened.
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 name of the cop is Layout/IndentationWidth
. This line with bare IndentationWidth
should probably never have been here, so you were right to remove it.
SupportedStyles: | ||
- when_needed | ||
- always | ||
EnforcedStyle: always |
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.
when_needed
does not appear to be allowed anymore.
Error: invalid EnforcedStyle 'when_needed' for Style/FrozenStringLiteralComment found in config/rubocop-style.yml
Valid choices are: always, never
@@ -328,11 +328,6 @@ Style/ExpandPathArguments: | |||
Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`." | |||
Enabled: false | |||
|
|||
Style/FlipFlop: |
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.
Moved to rubocop-airbnb/config/rubocop-lint.yml
… in RuboCop::Cop::Rails::ReflectionClassName
@@ -7,3 +7,6 @@ Gemspec/RequiredRubyVersion: | |||
Enabled: false | |||
Include: | |||
- '**/*.gemspec' | |||
|
|||
Gemspec/RubyVersionGlobalsUsage: |
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.
This is enabled by default -- is it worth explicitly enabling here or should we just use the rubocop default settings?
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.
Let's explicitly enable it here for clarity. I don't know where the Rubocop defaults are set but I see tons of enabled cops in our configs that are probably also enabled by default.
@@ -344,7 +343,6 @@ Layout/MultilineMethodCallIndentation: | |||
SupportedStyles: | |||
- aligned | |||
- indented | |||
IndentationWidth: |
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 name of the cop is Layout/IndentationWidth
. This line with bare IndentationWidth
should probably never have been here, so you were right to remove it.
EnforcedStyle: when_needed | ||
SupportedStyles: | ||
- when_needed | ||
- always |
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.
Should this stay here, but with - never
and - always
as the choices?
@@ -2,11 +2,6 @@ | |||
# They are custom built for use inside Airbnb and address issues that we have experienced in | |||
# testing and production. | |||
|
|||
Airbnb/ClassName: |
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 can probably delete class_name.rb and class_name_spec.rb now that we're using Rubocop's ReflectionClassName
cop instead.
@@ -551,3 +551,6 @@ Layout/TrailingWhitespace: | |||
Description: Avoid trailing whitespace. | |||
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-whitespace | |||
Enabled: true | |||
|
|||
Layout/IndentFirstParameter: |
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.
It looks like the documented name is Layout/FirstParameterIndentation
. Let's use that name instead of the alias to make it easier to find documentation.
@@ -7,3 +7,6 @@ Gemspec/RequiredRubyVersion: | |||
Enabled: false | |||
Include: | |||
- '**/*.gemspec' | |||
|
|||
Gemspec/RubyVersionGlobalsUsage: |
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.
Let's explicitly enable it here for clarity. I don't know where the Rubocop defaults are set but I see tons of enabled cops in our configs that are probably also enabled by default.
@@ -227,7 +227,7 @@ Layout/FirstMethodParameterLineBreak: | |||
Enabled: false | |||
|
|||
# Supports --auto-correct | |||
Layout/FirstParameterIndentation: | |||
Layout/IndentFirstArgument: |
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 new name is Layout/FirstArgumentIndentation
.
@@ -238,7 +238,7 @@ Layout/FirstParameterIndentation: | |||
- special_for_inner_method_call_in_parentheses | |||
|
|||
# Supports --auto-correct | |||
Layout/IndentArray: | |||
Layout/IndentFirstArrayElement: |
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 new name is Layout/FirstArrayElementIndentation
.
|
||
# Supports --auto-correct | ||
Layout/IndentHash: | ||
Layout/IndentFirstHashElement: |
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 new name is Layout/FirstHashElementIndentation
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 think all of these Indent
-> Indentation
name changes are in rubocop 0.77, which isn't released yet.
This is great. I would also like to see this change:
|
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.
Looks like Layout/EmptyLineAfterGuardClause
was already disabled and the class_name.rb cop was already removed.
LGTM!
This will drop support for ruby 2.2 and add it for ruby 2.6. It's probably best reviewed commit by commit as I tried to bundle changes logically -- many cops switched files and that will be more clear if you look solely at commits.
I looked through the changelogs for rubocop up to 0.76.0 and the changelogs for rubocop-performance and rubocop-rails.