Skip to content
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

Merged
merged 18 commits into from Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions rubocop-airbnb/.rubocop.yml
@@ -1,3 +1,6 @@
require:
- rubocop-performance
- rubocop-rails
inherit_from:
- .rubocop_airbnb.yml
- ./config/default.yml
Expand Down
8 changes: 3 additions & 5 deletions rubocop-airbnb/config/rubocop-layout.yml
Expand Up @@ -227,7 +227,7 @@ Layout/FirstMethodParameterLineBreak:
Enabled: false

# Supports --auto-correct
Layout/FirstParameterIndentation:
Layout/IndentFirstArgument:
Copy link
Contributor

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.

Description: Checks the indentation of the first parameter in a method call.
Enabled: true
EnforcedStyle: consistent
Expand All @@ -238,7 +238,7 @@ Layout/FirstParameterIndentation:
- special_for_inner_method_call_in_parentheses

# Supports --auto-correct
Layout/IndentArray:
Layout/IndentFirstArrayElement:
Copy link
Contributor

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.

Description: Checks the indentation of the first element in an array literal.
Enabled: true
EnforcedStyle: consistent
Expand All @@ -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:
Copy link
Contributor

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

Copy link
Collaborator Author

@zachsabin zachsabin Nov 13, 2019

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.

rubocop/rubocop#7468

Description: Checks the indentation of the first key in a hash literal.
Enabled: true
EnforcedStyle: consistent
Expand Down Expand Up @@ -344,7 +343,6 @@ Layout/MultilineMethodCallIndentation:
SupportedStyles:
- aligned
- indented
IndentationWidth:
Copy link
Collaborator Author

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.

Copy link
Contributor

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.


Layout/MultilineMethodDefinitionBraceLayout:
Description: >-
Expand Down
8 changes: 4 additions & 4 deletions rubocop-airbnb/config/rubocop-lint.yml
Expand Up @@ -237,20 +237,20 @@ Lint/UnderscorePrefixedVariableName:
Lint/UnifiedInteger:
Enabled: false

Lint/UnneededCopDisableDirective:
Lint/RedundantCopDisableDirective:
Description: >-
Checks for rubocop:disable comments that can be removed.
Note: this cop is not disabled when disabling all cops. It must be explicitly disabled.
Enabled: true

Lint/UnneededCopEnableDirective:
Lint/RedundantCopEnableDirective:
Description: Checks for rubocop:enable comments that can be removed.
Enabled: true

Lint/UnneededRequireStatement:
Lint/RedundantRequireStatement:
Enabled: false

Lint/UnneededSplatExpansion:
Lint/RedundantSplatExpansion:
Enabled: false

Lint/UnreachableCode:
Expand Down
13 changes: 5 additions & 8 deletions rubocop-airbnb/config/rubocop-style.yml
Expand Up @@ -360,10 +360,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
Copy link
Contributor

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?

EnforcedStyle: always
Copy link
Collaborator Author

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


Style/GlobalVars:
Description: Do not introduce global variables.
Expand Down Expand Up @@ -922,20 +919,20 @@ 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
Expand Down
Expand Up @@ -14,7 +14,7 @@ def enforce_violation(node)
alias on_send enforce_violation
alias on_if enforce_violation

Util::ASGN_NODES.each do |type|
RuboCop::AST::Node::ASSIGNMENTS.each do |type|
define_method("on_#{type}") do |node|
enforce_violation(node)
end
Expand Down
4 changes: 3 additions & 1 deletion rubocop-airbnb/rubocop-airbnb.gemspec
Expand Up @@ -25,7 +25,9 @@ Gem::Specification.new do |spec|
'Gemfile',
]

spec.add_dependency('rubocop', '~> 0.58.0')
spec.add_dependency('rubocop', '~> 0.76.0')
spec.add_dependency('rubocop-performance', '~> 1.5.0')
spec.add_dependency('rubocop-rails', '~> 2.3.2')
spec.add_dependency('rubocop-rspec', '~> 1.30.0')
spec.add_development_dependency('rspec', '~> 3.5')
end