@@ -11,6 +11,8 @@ AllCops:
11
11
- " vendor/bundle/**/*"
12
12
- " vendor/bundle/**/.*"
13
13
TargetRubyVersion : 2.5
14
+ # we might wanna adopt rspec and rake but it's a bit annoying for now
15
+ SuggestExtensions : false
14
16
15
17
Bundler/OrderedGems :
16
18
Description : Gems should be alphabetically sorted within groups.
@@ -43,11 +45,17 @@ Layout/SpaceAroundMethodCallOperator:
43
45
Description : Checks method call operators to not have spaces around them.
44
46
Enabled : true
45
47
48
+ Layout/SpaceBeforeBrackets :
49
+ Enabled : true
50
+
46
51
Layout/SpaceInsideHashLiteralBraces :
47
52
Description : Use spaces inside hash literal braces - or don't.
48
53
StyleGuide : https://github.com/rubocop-hq/ruby-style-guide#spaces-operators
49
54
EnforcedStyle : no_space
50
55
56
+ Lint/AmbiguousAssignment :
57
+ Enabled : true
58
+
51
59
Lint/AmbiguousRegexpLiteral :
52
60
Description : Checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
53
61
Exclude :
@@ -58,46 +66,95 @@ Lint/AmbiguousRegexpLiteral:
58
66
Lint/BinaryOperatorWithIdenticalOperands :
59
67
Enabled : true
60
68
69
+ Lint/ConstantDefinitionInBlock :
70
+ Exclude :
71
+ - " spec/**/*_spec.rb"
72
+
73
+ Lint/DeprecatedConstants :
74
+ Enabled : true
75
+
61
76
Lint/DeprecatedOpenSSLConstant :
62
77
Description : Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`.
63
78
Enabled : true
64
79
80
+ Lint/DuplicateBranch :
81
+ Enabled : true
82
+
65
83
Lint/DuplicateElsifCondition :
66
84
Enabled : true
67
85
86
+ Lint/DuplicateRegexpCharacterClassElement :
87
+ Enabled : true
88
+
68
89
Lint/DuplicateRescueException :
69
90
Enabled : true
70
91
92
+ Lint/EmptyBlock :
93
+ Enabled : true
94
+
95
+ Lint/EmptyClass :
96
+ Enabled : true
97
+
71
98
Lint/EmptyConditionalBody :
72
99
Enabled : true
73
100
74
101
Lint/FloatComparison :
75
102
Enabled : true
76
103
104
+ Lint/LambdaWithoutLiteralBlock :
105
+ Enabled : true
106
+
77
107
Lint/MissingSuper :
78
108
Enabled : true
79
109
80
110
Lint/MixedRegexpCaptureTypes :
81
111
Description : Do not mix named captures and numbered captures in a Regexp literal.
82
112
Enabled : true
83
113
114
+ Lint/NoReturnInBeginEndBlocks :
115
+ Enabled : true
116
+
117
+ Lint/NumberedParameterAssignment :
118
+ Enabled : true
119
+
120
+ Lint/OrAssignmentToConstant :
121
+ Enabled : true
122
+
84
123
Lint/OutOfRangeRegexpRef :
85
124
Enabled : true
86
125
87
126
Lint/RaiseException :
88
127
Description : Checks for `raise` or `fail` statements which are raising `Exception` class.
89
128
Enabled : true
90
129
130
+ Lint/RedundantDirGlobSort :
131
+ Enabled : true
132
+
91
133
Lint/SelfAssignment :
92
134
Enabled : true
93
135
94
136
Lint/StructNewOverride :
95
137
Description : Disallow overriding the `Struct` built-in methods via `Struct.new`.
96
138
Enabled : true
97
139
140
+ Lint/SymbolConversion :
141
+ Enabled : true
142
+
143
+ Lint/ToEnumArguments :
144
+ Enabled : true
145
+
98
146
Lint/TopLevelReturnWithArgument :
99
147
Enabled : true
100
148
149
+ Lint/TripleQuotes :
150
+ Enabled : true
151
+
152
+ Lint/UnexpectedBlockArity :
153
+ Enabled : true
154
+
155
+ Lint/UnmodifiedReduceAccumulator :
156
+ Enabled : true
157
+
101
158
Lint/UnreachableLoop :
102
159
Enabled : true
103
160
@@ -125,6 +182,7 @@ Metrics/MethodLength:
125
182
126
183
Metrics/ModuleLength :
127
184
Description : Avoid modules longer than 100 lines of code.
185
+ Max : 300
128
186
Exclude :
129
187
- " lib/simplecov.rb"
130
188
@@ -140,16 +198,22 @@ Naming/FileName:
140
198
- " spec/fixtures/utf-8.rb"
141
199
142
200
Style/AccessorGrouping :
143
- Enabled : true
201
+ Enabled : true
202
+
203
+ Style/ArgumentsForwarding :
204
+ Enabled : true
144
205
145
206
Style/ArrayCoercion :
146
- Enabled : true
207
+ Enabled : true
147
208
148
209
Style/BisectedAttrAccessor :
149
- Enabled : true
210
+ Enabled : true
150
211
151
212
Style/CaseLikeIf :
152
- Enabled : true
213
+ Enabled : true
214
+
215
+ Style/CollectionCompact :
216
+ Enabled : true
153
217
154
218
Style/CollectionMethods :
155
219
Description : Enforces the use of consistent method names from the Enumerable module.
@@ -168,9 +232,15 @@ Style/DoubleNegation:
168
232
StyleGuide : https://github.com/rubocop-hq/ruby-style-guide#no-bang-bang
169
233
Enabled : false
170
234
235
+ Style/DocumentDynamicEvalDefinition :
236
+ Enabled : true
237
+
238
+ Style/EndlessMethod :
239
+ Enabled : true
240
+
171
241
Style/ExplicitBlockArgument :
172
- # capturing as a proc has a performance hit, so is a case by case choice
173
- Enabled : false
242
+ # capturing as a proc has a performance hit, so is a case by case choice
243
+ Enabled : false
174
244
175
245
Style/ExponentialNotation :
176
246
Description : When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).
@@ -186,21 +256,24 @@ Style/FrozenStringLiteralComment:
186
256
- " spec/fixtures/**/*"
187
257
188
258
Style/GlobalStdStream :
189
- Enabled : true
259
+ Enabled : true
190
260
191
261
Style/GuardClause :
192
262
Description : Use a guard clause instead of wrapping the code inside a conditional expression.
193
263
Enabled : false
194
264
195
265
Style/HashAsLastArrayItem :
196
- Enabled : true
266
+ Enabled : true
197
267
198
268
Style/HashEachMethods :
199
269
Description : Use Hash#each_key and Hash#each_value.
200
270
Enabled : true
201
271
272
+ Style/HashExcept :
273
+ Enabled : true
274
+
202
275
Style/HashLikeCase :
203
- Enabled : true
276
+ Enabled : true
204
277
205
278
Style/HashTransformKeys :
206
279
Description : Prefer `transform_keys` over `each_with_object` and `map`.
@@ -214,17 +287,29 @@ Style/HashSyntax:
214
287
Description : Checks hash literal syntax.
215
288
EnforcedStyle : ruby19
216
289
290
+ Style/IfWithBooleanLiteralBranches :
291
+ Enabled : true
292
+
293
+ Style/NegatedIfElseCondition :
294
+ Enabled : true
295
+
296
+ Style/NilLambda :
297
+ Enabled : true
298
+
217
299
Style/OptionalBooleanParameter :
218
- Enabled : true
300
+ Enabled : true
301
+
302
+ Style/RedundantArgument :
303
+ Enabled : true
219
304
220
305
Style/RedundantAssignment :
221
- Enabled : true
306
+ Enabled : true
222
307
223
308
Style/RedundantFetchBlock :
224
- Enabled : true
309
+ Enabled : true
225
310
226
311
Style/RedundantFileExtensionInRequire :
227
- Enabled : true
312
+ Enabled : true
228
313
229
314
Style/RedundantRegexpCharacterClass :
230
315
Description : Checks for unnecessary single-element Regexp character classes.
@@ -240,7 +325,7 @@ Style/RegexpLiteral:
240
325
Enabled : false
241
326
242
327
Style/SingleArgumentDig :
243
- Enabled : true
328
+ Enabled : true
244
329
245
330
Style/SlicingWithRange :
246
331
Description : Checks array slicing is done with endless ranges when suitable.
@@ -254,12 +339,15 @@ Style/SpecialGlobalVars:
254
339
- " lib/simplecov/defaults.rb"
255
340
256
341
Style/StringConcatenation :
257
- Enabled : true
342
+ Enabled : true
258
343
259
344
Style/StringLiterals :
260
345
Description : Allow double-quoted strings without interpolation.
261
346
EnforcedStyle : double_quotes
262
347
348
+ Style/SwapValues :
349
+ Enabled : true
350
+
263
351
Style/TrailingCommaInArrayLiteral :
264
352
EnforcedStyleForMultiline : no_comma
265
353
0 commit comments