Skip to content

Commit 70143f0

Browse files
committed
(MAINT) Update Rubocop and config for Ruby >= 2.3.0
1 parent a0ef439 commit 70143f0

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

.rubocop.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require: rubocop-performance
12
inherit_from: .rubocop_todo.yml
23

34
AllCops:
@@ -34,7 +35,7 @@ Lint/EnsureReturn:
3435
Enabled: false
3536

3637
# MAYBE useful - errors when rescue {} happens.
37-
Lint/HandleExceptions:
38+
Lint/SuppressedException:
3839
Enabled: false
3940

4041
# MAYBE useful - but too many instances
@@ -119,7 +120,7 @@ Lint/ParenthesesAsGroupedExpression:
119120
Lint/RescueException:
120121
Enabled: false
121122

122-
Lint/StringConversionInInterpolation:
123+
Lint/RedundantStringCoercion:
123124
Enabled: false
124125

125126
Lint/UnusedBlockArgument:
@@ -143,13 +144,13 @@ Naming/AccessorMethodName:
143144
Style/Alias:
144145
Enabled: false
145146

146-
Layout/AlignArray:
147+
Layout/ArrayAlignment:
147148
Enabled: false
148149

149-
Layout/AlignHash:
150+
Layout/HashAlignment:
150151
Enabled: false
151152

152-
Layout/AlignParameters:
153+
Layout/ParameterAlignment:
153154
Enabled: false
154155

155156
Metrics/BlockNesting:
@@ -161,9 +162,6 @@ Style/AsciiComments:
161162
Style/Attr:
162163
Enabled: false
163164

164-
Style/BracesAroundHashParameters:
165-
Enabled: false
166-
167165
Style/CaseEquality:
168166
Enabled: false
169167

@@ -198,7 +196,7 @@ Style/WhenThen:
198196
Style/WordArray:
199197
Enabled: false
200198

201-
Style/UnneededPercentQ:
199+
Style/RedundantPercentQ:
202200
Enabled: false
203201

204202
Layout/Tab:
@@ -207,7 +205,7 @@ Layout/Tab:
207205
Layout/SpaceBeforeSemicolon:
208206
Enabled: false
209207

210-
Layout/TrailingBlankLines:
208+
Layout/TrailingEmptyLines:
211209
Enabled: false
212210

213211
Layout/SpaceInsideBlockBraces:
@@ -292,10 +290,10 @@ Style/EachWithObject:
292290
Layout/EmptyLineBetweenDefs:
293291
Enabled: false
294292

295-
Layout/IndentArray:
293+
Layout/FirstArrayElementIndentation:
296294
Enabled: false
297295

298-
Layout/IndentHash:
296+
Layout/FirstHashElementIndentation:
299297
Enabled: false
300298

301299
Layout/IndentationConsistency:
@@ -313,7 +311,7 @@ Layout/EmptyLinesAroundAccessModifier:
313311
Style/EmptyLiteral:
314312
Enabled: false
315313

316-
Metrics/LineLength:
314+
Layout/LineLength:
317315
Enabled: false
318316

319317
Style/MethodCallWithoutArgsParentheses:
@@ -526,7 +524,7 @@ Layout/EmptyLinesAroundBlockBody:
526524
Layout/EmptyLinesAroundClassBody:
527525
Enabled: false
528526

529-
Style/UnneededInterpolation:
527+
Style/RedundantInterpolation:
530528
Enabled: false
531529

532530
Style/SymbolProc:
@@ -575,5 +573,21 @@ Naming/VariableNumber:
575573
Layout/EndOfLine:
576574
EnforcedStyle: lf
577575

578-
Layout/IndentHeredoc: # Not appicable on Ruby 2.1
576+
Layout/HeredocIndentation: # Not appicable on Ruby 2.1
579577
Enabled: false
578+
579+
Lint/RaiseException:
580+
Enabled: true
581+
582+
Lint/StructNewOverride:
583+
Enabled: true
584+
585+
Style/HashEachMethods:
586+
Enabled: true
587+
588+
Style/HashTransformKeys:
589+
Enabled: false # requires Ruby 2.5
590+
591+
Style/HashTransformValues:
592+
Enabled: false # requires Ruby 2.4
593+

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ group :development do
3737
gem 'pry-byebug'
3838
end
3939

40+
gem 'rubocop', '~> 0.81.0' # last release that supports Ruby 2.3.0
4041
gem 'rubocop-rspec'
41-
gem 'rubocop', '~> 0.57.2'
42+
gem 'rubocop-performance'
4243

4344
# Evaluate Gemfile.local if it exists
4445
if File.exists? "#{__FILE__}.local"

0 commit comments

Comments
 (0)