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
Changes from 14 commits
cacb774
72066c1
9d2dd27
72bfac7
784a4c8
1421a32
2bfe2db
b0a5edf
4a190d2
7a94864
5493a81
81df175
cb67d63
cb8d599
c04fccf
944aac1
4591307
39f16ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
require: | ||
- rubocop-performance | ||
- rubocop-rails | ||
inherit_from: | ||
- .rubocop_airbnb.yml | ||
- ./config/default.yml | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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. |
||
Enabled: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. The new name is |
||
Description: Checks the indentation of the first parameter in a method call. | ||
Enabled: true | ||
EnforcedStyle: consistent | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. The new name is |
||
Description: Checks the indentation of the first element in an array literal. | ||
Enabled: true | ||
EnforcedStyle: consistent | ||
|
@@ -248,10 +248,9 @@ Layout/IndentAssignment: | |
Description: Checks the indentation of the first line of the right-hand-side of a | ||
multi-line assignment. | ||
Enabled: true | ||
IndentationWidth: | ||
|
||
# Supports --auto-correct | ||
Layout/IndentHash: | ||
Layout/IndentFirstHashElement: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new name is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all of these |
||
Description: Checks the indentation of the first key in a hash literal. | ||
Enabled: true | ||
EnforcedStyle: consistent | ||
|
@@ -344,7 +343,6 @@ Layout/MultilineMethodCallIndentation: | |
SupportedStyles: | ||
- aligned | ||
- indented | ||
IndentationWidth: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name of the cop is |
||
|
||
Layout/MultilineMethodDefinitionBraceLayout: | ||
Description: >- | ||
|
@@ -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 commentThe 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. |
||
Description: 'No spaces after ( or before ).' | ||
StyleGuide: '#spaces-braces' | ||
Enabled: true | ||
|
||
Layout/SpaceInsideArrayLiteralBrackets: | ||
EnforcedStyle: no_space | ||
SupportedStyles: | ||
|
@@ -558,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 commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the documented name is |
||
Enabled: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,3 +83,6 @@ Naming/VariableName: | |
|
||
Naming/VariableNumber: | ||
Enabled: false | ||
|
||
Naming/RescuedExceptionsVariableName: | ||
Enabled: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Moved to |
||
Description: Checks for flip flops | ||
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-flip-flops | ||
Enabled: false | ||
|
||
Style/For: | ||
Description: Checks use of for or each in multiline loops. | ||
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-for-loops | ||
|
@@ -360,10 +355,7 @@ Style/FrozenStringLiteralComment: | |
Description: Add the frozen_string_literal comment to the top of files to help transition | ||
from Ruby 2.3.0 to Ruby 3.0. | ||
Enabled: false | ||
EnforcedStyle: when_needed | ||
SupportedStyles: | ||
- when_needed | ||
- always | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this stay here, but with |
||
EnforcedStyle: always | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
Style/GlobalVars: | ||
Description: Do not introduce global variables. | ||
|
@@ -735,6 +727,11 @@ Style/RedundantSelf: | |
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-self-unless-required | ||
Enabled: true | ||
|
||
# Supports --auto-correct | ||
Style/RedundantSortBy: | ||
Description: Use `sort` instead of `sort_by { |x| x }`. | ||
Enabled: false | ||
|
||
# Supports --auto-correct | ||
Style/RegexpLiteral: | ||
Description: Use / or %r around regular expressions. | ||
|
@@ -763,6 +760,12 @@ Style/ReturnNil: | |
Style/SafeNavigation: | ||
Enabled: false | ||
|
||
# Supports --auto-correct | ||
Style/Sample: | ||
Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`. | ||
Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code | ||
Enabled: false | ||
|
||
# Supports --auto-correct | ||
Style/SelfAssignment: | ||
Description: Checks for places where self-assignment shorthand should have been used. | ||
|
@@ -856,6 +859,11 @@ Style/StringMethods: | |
PreferredMethods: | ||
intern: to_sym | ||
|
||
# Supports --auto-correct | ||
Style/Strip: | ||
Description: Use `strip` instead of `lstrip.rstrip`. | ||
Enabled: false | ||
|
||
Style/StructInheritance: | ||
Description: Checks for inheritance from Struct.new. | ||
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-extend-struct-new | ||
|
@@ -922,24 +930,27 @@ Style/UnlessElse: | |
Enabled: true | ||
|
||
# Supports --auto-correct | ||
Style/UnneededCapitalW: | ||
Style/RedundantCapitalW: | ||
Description: Checks for %W when interpolation is not needed. | ||
Enabled: false | ||
|
||
Style/UnneededCondition: | ||
Style/RedundantCondition: | ||
Enabled: false | ||
|
||
# Supports --auto-correct | ||
Style/UnneededInterpolation: | ||
Style/RedundantInterpolation: | ||
Description: Checks for strings that are just an interpolated expression. | ||
Enabled: false | ||
|
||
# Supports --auto-correct | ||
Style/UnneededPercentQ: | ||
Style/RedundantPercentQ: | ||
Description: Checks for %q/%Q when single quotes or double quotes would do. | ||
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#percent-q | ||
Enabled: false | ||
|
||
Style/RedundantSort: | ||
Enabled: false | ||
|
||
Style/UnpackFirst: | ||
Enabled: false | ||
|
||
|
This file was deleted.
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.