Skip to content

Commit c1cd791

Browse files
Update bundle and add new cops
add new cops: * Lint/DataDefineOverride * Lint/UnreachablePatternBranch * Style/FileOpen * Style/MapJoin * Style/OneClassPerFile * Style/PartitionInsteadOfDoubleSelect * Style/PredicateWithKind * Style/ReduceToHash * Style/RedundantMinMaxBy * Style/SelectByKind * Style/SelectByRange * Style/TallyMethod
1 parent 1fd845f commit c1cd791

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

cops/lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Lint/ConstantReassignment:
1919
Lint/CopDirectiveSyntax:
2020
Enabled: true
2121

22+
Lint/DataDefineOverride:
23+
Enabled: true
24+
2225
Lint/DeprecatedConstants:
2326
Enabled: true
2427

@@ -139,6 +142,9 @@ Lint/UnmodifiedReduceAccumulator:
139142
Lint/UnreachableCode:
140143
Enabled: true
141144

145+
Lint/UnreachablePatternBranch:
146+
Enabled: true
147+
142148
Lint/UselessConstantScoping:
143149
Enabled: true
144150

cops/style.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ Style/FileEmpty:
106106
Style/FileNull:
107107
Enabled: true
108108

109+
Style/FileOpen:
110+
Enabled: true
111+
109112
Style/FileRead:
110113
Enabled: true
111114

@@ -191,6 +194,9 @@ Style/MapCompactWithConditionalBlock:
191194
Style/MapIntoArray:
192195
Enabled: true
193196

197+
Style/MapJoin:
198+
Enabled: true
199+
194200
Style/MapToHash:
195201
Enabled: true
196202

@@ -231,6 +237,9 @@ Style/NumberedParametersLimit:
231237
Style/ObjectThen:
232238
Enabled: true
233239

240+
Style/OneClassPerFile:
241+
Enabled: true
242+
234243
Style/OneLineConditional:
235244
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
236245
Enabled: false
@@ -250,12 +259,21 @@ Style/ParenthesesAroundCondition:
250259
AllowInMultilineConditions: true
251260
AllowSafeAssignment: true
252261

262+
Style/PartitionInsteadOfDoubleSelect:
263+
Enabled: true
264+
253265
Style/PercentLiteralDelimiters:
254266
Enabled: false
255267

268+
Style/PredicateWithKind:
269+
Enabled: true
270+
256271
Style/QuotedSymbols:
257272
Enabled: true
258273

274+
Style/ReduceToHash:
275+
Enabled: true
276+
259277
Style/RedundantArgument:
260278
Enabled: true
261279

@@ -304,6 +322,9 @@ Style/RedundantInterpolationUnfreeze:
304322
Style/RedundantLineContinuation:
305323
Enabled: true
306324

325+
Style/RedundantMinMaxBy:
326+
Enabled: true
327+
307328
Style/RedundantRegexpArgument:
308329
Enabled: true
309330

@@ -335,6 +356,12 @@ Style/ReverseFind:
335356
Style/SafeNavigationChainLength:
336357
Enabled: true
337358

359+
Style/SelectByKind:
360+
Enabled: true
361+
362+
Style/SelectByRange:
363+
Enabled: true
364+
338365
Style/SelectByRegexp:
339366
Enabled: true
340367

@@ -371,6 +398,9 @@ Style/SuperWithArgsParentheses:
371398
Style/SwapValues:
372399
Enabled: true
373400

401+
Style/TallyMethod:
402+
Enabled: true
403+
374404
Style/WhileUntilModifier:
375405
Enabled: false
376406

0 commit comments

Comments
 (0)