kuyio-rubocop 0.1.4 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -1
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/kuyio-rubocop.gemspec +12 -8
- data/lib/kuyio/rubocop/version.rb +1 -1
- data/lib/kuyio/rubocop.rb +2 -0
- data/rubocop-all.yml +14 -0
- data/rubocop-bundler.yml +4 -0
- data/rubocop-default.yml +19 -0
- data/rubocop-gemspec.yml +12 -0
- data/rubocop-layout.yml +306 -0
- data/rubocop-lint.yml +397 -0
- data/rubocop-metrics.yml +44 -0
- data/rubocop-naming.yml +65 -0
- data/rubocop-performance.yml +146 -0
- data/rubocop-rails.yml +195 -0
- data/rubocop-rspec.yml +160 -0
- data/rubocop-security.yml +18 -0
- data/rubocop-style.yml +464 -0
- metadata +41 -15
- data/default.yml +0 -178
data/rubocop-lint.yml
ADDED
@@ -0,0 +1,397 @@
|
|
1
|
+
---
|
2
|
+
# Checks for mistyped shorthand assignments.
|
3
|
+
Lint/AmbiguousAssignment:
|
4
|
+
Enabled: true
|
5
|
+
|
6
|
+
# Checks for ambiguous block association with method when param passed without
|
7
|
+
# parentheses.
|
8
|
+
Lint/AmbiguousBlockAssociation:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
# Checks for ambiguous operators in the first argument of a method invocation
|
12
|
+
# without parentheses.
|
13
|
+
Lint/AmbiguousOperator:
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
# Looks for expressions containing multiple binary operators where precedence
|
17
|
+
# is ambiguous due to lack of parentheses.
|
18
|
+
Lint/AmbiguousOperatorPrecedence:
|
19
|
+
Enabled: true
|
20
|
+
|
21
|
+
# Checks for ambiguous ranges.
|
22
|
+
Lint/AmbiguousRange:
|
23
|
+
Enabled: true
|
24
|
+
|
25
|
+
# This cop checks for ambiguous regexp literals in the first argument of
|
26
|
+
# a method invocation without parentheses.
|
27
|
+
Lint/AmbiguousRegexpLiteral:
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
# This cop checks for assignments in the conditions of if/while/until.
|
31
|
+
# Forbid assignments within conditions.
|
32
|
+
Lint/AssignmentInCondition:
|
33
|
+
Enabled: true
|
34
|
+
AllowSafeAssignment: false
|
35
|
+
|
36
|
+
# Checks for places where binary operator has identical operands
|
37
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
38
|
+
Enabled: true
|
39
|
+
|
40
|
+
# Default values in optional keyword arguments and optional ordinal arguments
|
41
|
+
# should not refer back to the name of the argument.
|
42
|
+
Lint/CircularArgumentReference:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
Lint/ConstantDefinitionInBlock: # (new in 0.91)
|
46
|
+
Enabled: true
|
47
|
+
|
48
|
+
# Checks for overwriting an exception with an exception result by use rescue =>.
|
49
|
+
Lint/ConstantOverwrittenInRescue:
|
50
|
+
Enabled: true
|
51
|
+
|
52
|
+
# Check for debugger calls.
|
53
|
+
Lint/Debugger:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
# Check for deprecated class method calls.
|
57
|
+
Lint/DeprecatedClassMethods:
|
58
|
+
Enabled: true
|
59
|
+
|
60
|
+
# Checks for deprecated constants.
|
61
|
+
Lint/DeprecatedConstants:
|
62
|
+
Enabled: true
|
63
|
+
|
64
|
+
# Algorithmic constants for OpenSSL::Cipher and OpenSSL::Digest deprecated since OpenSSL version 2.2.0.
|
65
|
+
# Prefer passing a string instead.
|
66
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintdeprecatedopensslconstant
|
67
|
+
Lint/DeprecatedOpenSSLConstant:
|
68
|
+
Enabled: true
|
69
|
+
|
70
|
+
# Checks that there are no repeated bodies within if/unless, case-when, case-in
|
71
|
+
# and rescue constructs.
|
72
|
+
Lint/DuplicateBranch:
|
73
|
+
Enabled: true
|
74
|
+
IgnoreLiteralBranches: true
|
75
|
+
IgnoreConstantBranches: true
|
76
|
+
|
77
|
+
# Checks that there are no repeated conditions used in if 'elsif'.
|
78
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintduplicateelsifcondition
|
79
|
+
Lint/DuplicateElsifCondition:
|
80
|
+
Enabled: true
|
81
|
+
|
82
|
+
# Checks for duplicated magic comments.
|
83
|
+
Lint/DuplicateMagicComment:
|
84
|
+
Enabled: true
|
85
|
+
|
86
|
+
# Checks for duplicate elements in Regexp character classes.
|
87
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
88
|
+
Enabled: true
|
89
|
+
|
90
|
+
Lint/DuplicateRequire: # (new in 0.90)
|
91
|
+
Enabled: true
|
92
|
+
|
93
|
+
# Checks that there are no repeated exceptions used in 'rescue' expressions.
|
94
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintduplicaterescueexception
|
95
|
+
Lint/DuplicateRescueException:
|
96
|
+
Enabled: true
|
97
|
+
|
98
|
+
# Check for immutable argument given to each_with_object.
|
99
|
+
Lint/EachWithObjectArgument:
|
100
|
+
Enabled: true
|
101
|
+
|
102
|
+
# Check for odd code arrangement in an else block.
|
103
|
+
Lint/ElseLayout:
|
104
|
+
Enabled: true
|
105
|
+
|
106
|
+
# Checks for blocks without a body. Such empty blocks are typically an
|
107
|
+
# oversight or we should provide a comment be clearer what we’re aiming for.
|
108
|
+
Lint/EmptyBlock:
|
109
|
+
Enabled: true
|
110
|
+
|
111
|
+
# Checks for classes and metaclasses without a body. Such empty classes and
|
112
|
+
# metaclasses are typically an oversight or we should provide a comment to be
|
113
|
+
# clearer what we’re aiming for.
|
114
|
+
Lint/EmptyClass:
|
115
|
+
Enabled: true
|
116
|
+
|
117
|
+
# Checks for the presence of if, elsif and unless branches without a body.
|
118
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintemptyconditionalbody
|
119
|
+
Lint/EmptyConditionalBody:
|
120
|
+
Enabled: true
|
121
|
+
|
122
|
+
# Checks for empty ensure block.
|
123
|
+
Lint/EmptyEnsure:
|
124
|
+
Enabled: true
|
125
|
+
|
126
|
+
Lint/EmptyFile: # (new in 0.90)
|
127
|
+
Enabled: true
|
128
|
+
|
129
|
+
# Checks for the presence of in pattern branches without a body.
|
130
|
+
Lint/EmptyInPattern:
|
131
|
+
Enabled: true
|
132
|
+
|
133
|
+
# Checks for the presence of `when` branches without a body.
|
134
|
+
Lint/EmptyWhen:
|
135
|
+
Enabled: true
|
136
|
+
|
137
|
+
# Do not use return in an ensure block.
|
138
|
+
Lint/EnsureReturn:
|
139
|
+
Enabled: true
|
140
|
+
|
141
|
+
# Checks for flip flops.
|
142
|
+
Lint/FlipFlop:
|
143
|
+
Enabled: true
|
144
|
+
|
145
|
+
# Checks for the presence of precise comparison of floating point numbers.
|
146
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintfloatcomparison
|
147
|
+
Lint/FloatComparison:
|
148
|
+
Enabled: true
|
149
|
+
|
150
|
+
# Catches floating-point literals too large or small for Ruby to represent.
|
151
|
+
Lint/FloatOutOfRange:
|
152
|
+
Enabled: true
|
153
|
+
|
154
|
+
# The number of parameters to format/sprint must match the fields.
|
155
|
+
Lint/FormatParameterMismatch:
|
156
|
+
Enabled: true
|
157
|
+
|
158
|
+
Lint/IdentityComparison: # (new in 0.91)
|
159
|
+
Enabled: true
|
160
|
+
|
161
|
+
# Checks for adjacent string literals on the same line, which could better be
|
162
|
+
# represented as a single string literal.
|
163
|
+
Lint/ImplicitStringConcatenation:
|
164
|
+
Enabled: true
|
165
|
+
|
166
|
+
# This cop checks for IO.select that is incompatible with Fiber Scheduler since
|
167
|
+
# Ruby 3.0.
|
168
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
169
|
+
Enabled: true
|
170
|
+
|
171
|
+
# Checks for attempts to use `private` or `protected` to set the visibility
|
172
|
+
# of a class method, which does not work.
|
173
|
+
Lint/IneffectiveAccessModifier:
|
174
|
+
Enabled: false
|
175
|
+
|
176
|
+
# Checks uses of lambda without a literal block. It emulates the following
|
177
|
+
# warning in Ruby 3.0:
|
178
|
+
Lint/LambdaWithoutLiteralBlock:
|
179
|
+
Enabled: true
|
180
|
+
|
181
|
+
# Checks of literals used in conditions.
|
182
|
+
Lint/LiteralAsCondition:
|
183
|
+
Enabled: true
|
184
|
+
|
185
|
+
# Checks for literals used in interpolation.
|
186
|
+
Lint/LiteralInInterpolation:
|
187
|
+
Enabled: true
|
188
|
+
|
189
|
+
# Checks for uses of *begin...end while/until something*.
|
190
|
+
Lint/Loop:
|
191
|
+
Enabled: false
|
192
|
+
|
193
|
+
# Checks for the presence of constructors and lifecycle callbacks without calls to super.
|
194
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintmissingsuper
|
195
|
+
Lint/MissingSuper:
|
196
|
+
Enabled: false
|
197
|
+
|
198
|
+
# Do not mix named captures and numbered captures in a Regexp literal
|
199
|
+
# because numbered capture is ignored if they’re mixed.
|
200
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintmixedregexpcapturetypes
|
201
|
+
Lint/MixedRegexpCaptureTypes:
|
202
|
+
Enabled: true
|
203
|
+
|
204
|
+
# Do not use nested method definitions.
|
205
|
+
Lint/NestedMethodDefinition:
|
206
|
+
Enabled: true
|
207
|
+
|
208
|
+
# Do not omit the accumulator when calling `next` in a `reduce`/`inject` block.
|
209
|
+
Lint/NextWithoutAccumulator:
|
210
|
+
Enabled: true
|
211
|
+
|
212
|
+
# Checks for non-atomic file operation. And then replace it with a nearly
|
213
|
+
# equivalent and atomic method.
|
214
|
+
Lint/NonAtomicFileOperation:
|
215
|
+
Enabled: true
|
216
|
+
|
217
|
+
# Checks for the presence of a return inside a begin..end block in assignment
|
218
|
+
# contexts.
|
219
|
+
Lint/NoReturnInBeginEndBlocks:
|
220
|
+
Enabled: true
|
221
|
+
|
222
|
+
# Checks for uses of numbered parameter assignment.
|
223
|
+
# Reason: Ruby >= 3.0 causes an error so no need to enable it.
|
224
|
+
Lint/NumberedParameterAssignment:
|
225
|
+
Enabled: false
|
226
|
+
|
227
|
+
# Looks for references of Regexp captures that are out of range and thus always returns nil.
|
228
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintoutofrangeregexpref
|
229
|
+
Lint/OutOfRangeRegexpRef:
|
230
|
+
Enabled: true
|
231
|
+
|
232
|
+
# Checks for unintended or-assignment to a constant.
|
233
|
+
Lint/OrAssignmentToConstant:
|
234
|
+
Enabled: true
|
235
|
+
|
236
|
+
# Checks for method calls with a space before the opening parenthesis.
|
237
|
+
Lint/ParenthesesAsGroupedExpression:
|
238
|
+
Enabled: true
|
239
|
+
|
240
|
+
# Checks for raise or fail statements which are raising Exception class.
|
241
|
+
Lint/RaiseException:
|
242
|
+
Enabled: true
|
243
|
+
|
244
|
+
# Checks for `rand(1)` calls. Such calls always return `0` and most likely
|
245
|
+
# a mistake.
|
246
|
+
Lint/RandOne:
|
247
|
+
Enabled: true
|
248
|
+
|
249
|
+
# This cop checks for redundant sort method to Dir.glob and Dir[]. Sort globbed
|
250
|
+
# results by default in Ruby 3.0.
|
251
|
+
Lint/RedundantDirGlobSort:
|
252
|
+
Enabled: true
|
253
|
+
|
254
|
+
# This cop checks for unneeded usages of splat expansion
|
255
|
+
Lint/RedundantSplatExpansion:
|
256
|
+
Enabled: false
|
257
|
+
|
258
|
+
# Checks for Object#to_s usage in string interpolation.
|
259
|
+
Lint/RedundantStringCoercion:
|
260
|
+
Enabled: true
|
261
|
+
|
262
|
+
# Checks if include or prepend is called in refine block.
|
263
|
+
Lint/RefinementImportMethods:
|
264
|
+
Enabled: true
|
265
|
+
|
266
|
+
# Use parentheses in the method call to avoid confusion about precedence.
|
267
|
+
Lint/RequireParentheses:
|
268
|
+
Enabled: true
|
269
|
+
|
270
|
+
# Checks that a range literal is enclosed in parentheses when the end of the
|
271
|
+
# range is at a line break.
|
272
|
+
Lint/RequireRangeParentheses:
|
273
|
+
Enabled: true
|
274
|
+
|
275
|
+
# Checks for uses a file requiring itself with require_relative.
|
276
|
+
Lint/RequireRelativeSelfPath:
|
277
|
+
Enabled: true
|
278
|
+
|
279
|
+
# Avoid rescuing the Exception class.
|
280
|
+
Lint/RescueException:
|
281
|
+
Enabled: true
|
282
|
+
|
283
|
+
# Ensures safe navigation isn't used with empty? in a conditional
|
284
|
+
Lint/SafeNavigationWithEmpty:
|
285
|
+
Enabled: true
|
286
|
+
|
287
|
+
# Checks for self-assignments.
|
288
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintselfassignment
|
289
|
+
Lint/SelfAssignment:
|
290
|
+
Enabled: true
|
291
|
+
|
292
|
+
# Checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception.
|
293
|
+
Lint/ShadowedException:
|
294
|
+
Enabled: false
|
295
|
+
|
296
|
+
# This cop looks for use of the same name as outer local variables
|
297
|
+
# for block arguments or block local variables.
|
298
|
+
Lint/ShadowingOuterLocalVariable:
|
299
|
+
Enabled: false
|
300
|
+
|
301
|
+
# Checks unexpected overrides of the Struct built-in methods via Struct.new.
|
302
|
+
Lint/StructNewOverride:
|
303
|
+
Enabled: true
|
304
|
+
|
305
|
+
# This cop checks for *rescue* blocks with no body.
|
306
|
+
Lint/SuppressedException:
|
307
|
+
Enabled: false
|
308
|
+
|
309
|
+
# Checks for uses of literal strings converted to a symbol where a literal
|
310
|
+
# symbol could be used instead.
|
311
|
+
Lint/SymbolConversion:
|
312
|
+
Enabled: true
|
313
|
+
EnforcedStyle: strict
|
314
|
+
|
315
|
+
# Ensures that to_enum/enum_for, called for the current method, has correct
|
316
|
+
# arguments.
|
317
|
+
Lint/ToEnumArguments:
|
318
|
+
Enabled: true
|
319
|
+
|
320
|
+
# Checks for top level return with arguments.
|
321
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#linttoplevelreturnwithargument
|
322
|
+
Lint/TopLevelReturnWithArgument:
|
323
|
+
Enabled: true
|
324
|
+
|
325
|
+
Lint/TrailingCommaInAttributeDeclaration: # (new in 0.90)
|
326
|
+
Enabled: true
|
327
|
+
|
328
|
+
# Checks for "triple quotes" (strings delimited by any odd number of quotes
|
329
|
+
# greater than 1).
|
330
|
+
Lint/TripleQuotes:
|
331
|
+
Enabled: true
|
332
|
+
|
333
|
+
# Do not use prefix `_` for a variable that is used.
|
334
|
+
Lint/UnderscorePrefixedVariableName:
|
335
|
+
Enabled: true
|
336
|
+
|
337
|
+
# Checks for a block that is known to need more positional block arguments than
|
338
|
+
# are given.
|
339
|
+
Lint/UnexpectedBlockArity:
|
340
|
+
Enabled: true
|
341
|
+
|
342
|
+
# Looks for reduce or inject blocks where the value returned (implicitly or
|
343
|
+
# explicitly) does not include the accumulator.
|
344
|
+
Lint/UnmodifiedReduceAccumulator:
|
345
|
+
Enabled: true
|
346
|
+
|
347
|
+
# This cop checks for using Fixnum or Bignum constant
|
348
|
+
Lint/UnifiedInteger:
|
349
|
+
Enabled: true
|
350
|
+
|
351
|
+
# Unreachable code.
|
352
|
+
Lint/UnreachableCode:
|
353
|
+
Enabled: true
|
354
|
+
|
355
|
+
# Checks for loops that will have at most one iteration.
|
356
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintunreachableloop
|
357
|
+
Lint/UnreachableLoop:
|
358
|
+
Enabled: true
|
359
|
+
|
360
|
+
# This cop checks for unused block arguments.
|
361
|
+
Lint/UnusedBlockArgument:
|
362
|
+
Enabled: true
|
363
|
+
|
364
|
+
# This cop checks for unused method arguments.
|
365
|
+
Lint/UnusedMethodArgument:
|
366
|
+
Enabled: true
|
367
|
+
|
368
|
+
# Checks for useless access modifiers.
|
369
|
+
Lint/UselessAccessModifier:
|
370
|
+
ContextCreatingMethods:
|
371
|
+
- class_methods
|
372
|
+
|
373
|
+
# Checks for useless assignment to a local variable.
|
374
|
+
Lint/UselessAssignment:
|
375
|
+
Enabled: true
|
376
|
+
|
377
|
+
# Checks for useless `else` in `begin..end` without `rescue`.
|
378
|
+
Lint/UselessElseWithoutRescue:
|
379
|
+
Enabled: true
|
380
|
+
|
381
|
+
Lint/UselessMethodDefinition: # (new in 0.90)
|
382
|
+
Enabled: true
|
383
|
+
|
384
|
+
# Checks for useless setter call to a local variable.
|
385
|
+
Lint/UselessSetterCall:
|
386
|
+
Enabled: true
|
387
|
+
|
388
|
+
Lint/UselessTimes: # (new in 0.91)
|
389
|
+
Enabled: true
|
390
|
+
|
391
|
+
# Looks for ruby2_keywords calls for methods that do not need it.
|
392
|
+
Lint/UselessRuby2Keywords:
|
393
|
+
Enabled: true
|
394
|
+
|
395
|
+
# Possible use of operator/literal/variable in void context.
|
396
|
+
Lint/Void:
|
397
|
+
Enabled: true
|
data/rubocop-metrics.yml
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
# A calculated magnitude based on number of assignments,
|
3
|
+
# branches, and conditions.
|
4
|
+
Metrics/AbcSize:
|
5
|
+
Enabled: true
|
6
|
+
Max: 54.28
|
7
|
+
|
8
|
+
# This cop checks if the length of a block exceeds some maximum value.
|
9
|
+
Metrics/BlockLength:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
# Avoid excessive block nesting.
|
13
|
+
Metrics/BlockNesting:
|
14
|
+
Enabled: true
|
15
|
+
Max: 4
|
16
|
+
|
17
|
+
# Avoid classes longer than 100 lines of code.
|
18
|
+
Metrics/ClassLength:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
# A complexity metric that is strongly correlated to the number
|
22
|
+
# of test cases needed to validate a method.
|
23
|
+
Metrics/CyclomaticComplexity:
|
24
|
+
Enabled: true
|
25
|
+
Max: 13
|
26
|
+
|
27
|
+
# Avoid methods longer than 10 lines of code.
|
28
|
+
Metrics/MethodLength:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
# Avoid modules longer than 100 lines of code.
|
32
|
+
Metrics/ModuleLength:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
# Avoid parameter lists longer than three or four parameters.
|
36
|
+
Metrics/ParameterLists:
|
37
|
+
Enabled: true
|
38
|
+
Max: 8
|
39
|
+
|
40
|
+
# A complexity metric geared towards measuring complexity for a human reader.
|
41
|
+
Metrics/PerceivedComplexity:
|
42
|
+
Enabled: true
|
43
|
+
Max: 14
|
44
|
+
|
data/rubocop-naming.yml
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
# Check the naming of accessor methods for get_/set_.
|
3
|
+
Naming/AccessorMethodName:
|
4
|
+
Enabled: false
|
5
|
+
|
6
|
+
# Use only ascii symbols in identifiers.
|
7
|
+
Naming/AsciiIdentifiers:
|
8
|
+
Enabled: true
|
9
|
+
|
10
|
+
# When defining binary operators, name the argument other.
|
11
|
+
Naming/BinaryOperatorParameterName:
|
12
|
+
Enabled: true
|
13
|
+
|
14
|
+
# Use CamelCase for classes and modules.'
|
15
|
+
Naming/ClassAndModuleCamelCase:
|
16
|
+
Enabled: true
|
17
|
+
|
18
|
+
# Constants should use SCREAMING_SNAKE_CASE.
|
19
|
+
Naming/ConstantName:
|
20
|
+
Enabled: true
|
21
|
+
|
22
|
+
# Use snake_case for source file names.
|
23
|
+
Naming/FileName:
|
24
|
+
Enabled: true
|
25
|
+
|
26
|
+
# Memoized methods whose instance variable name does not match the method name.
|
27
|
+
Naming/MemoizedInstanceVariableName:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
# Recommends the use of inclusive language instead of problematic terms.
|
31
|
+
Naming/InclusiveLanguage:
|
32
|
+
Enabled: true
|
33
|
+
CheckStrings: true
|
34
|
+
|
35
|
+
# Use the configured style when naming methods.
|
36
|
+
Naming/MethodName:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
# Method parameter names for how descriptive they are.
|
40
|
+
Naming/MethodParameterName:
|
41
|
+
Enabled: true
|
42
|
+
MinNameLength: 2
|
43
|
+
AllowedNames:
|
44
|
+
- _
|
45
|
+
|
46
|
+
# Use `spam?` instead of `is_spam?`
|
47
|
+
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
|
48
|
+
# NamePrefix: is_, has_, have_
|
49
|
+
# NamePrefixBlacklist: is_, has_, have_
|
50
|
+
# NameWhitelist: is_a?
|
51
|
+
Naming/PredicateName:
|
52
|
+
Enabled: true
|
53
|
+
ForbiddenPrefixes: is_
|
54
|
+
Exclude:
|
55
|
+
- 'spec/**/*'
|
56
|
+
- 'features/**/*'
|
57
|
+
|
58
|
+
# Use the configured style when naming variables.
|
59
|
+
Naming/VariableName:
|
60
|
+
EnforcedStyle: snake_case
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
# Use the configured style when numbering variables.
|
64
|
+
Naming/VariableNumber:
|
65
|
+
Enabled: false
|
@@ -0,0 +1,146 @@
|
|
1
|
+
---
|
2
|
+
require:
|
3
|
+
- rubocop-performance
|
4
|
+
|
5
|
+
# Used to identify usages of ancestors.include? and change them to use ⇐ instead.
|
6
|
+
# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performanceancestorsinclude
|
7
|
+
Performance/AncestorsInclude:
|
8
|
+
Enabled: true
|
9
|
+
|
10
|
+
# Identifies places where numeric argument to BigDecimal should be converted to string.
|
11
|
+
# Initializing from String is faster than from Numeric for BigDecimal.
|
12
|
+
# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancebigdecimalwithnumericargument
|
13
|
+
Performance/BigDecimalWithNumericArgument:
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
Performance/BlockGivenWithExplicitBlock: # (new in 1.9)
|
17
|
+
Enabled: true
|
18
|
+
|
19
|
+
# Use `caller(n..n)` instead of `caller`.
|
20
|
+
Performance/Caller:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
# Use `casecmp` rather than `downcase ==`.
|
24
|
+
Performance/Casecmp:
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
Performance/CollectionLiteralInLoop: # (new in 1.8)
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
# Identifies places where Concurrent.monotonic_time can be replaced by
|
31
|
+
# Process.clock_gettime(Process::CLOCK_MONOTONIC).
|
32
|
+
Performance/ConcurrentMonotonicTime:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
Performance/ConstantRegexp: # (new in 1.9)
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
# Use `str.{start,end}_with?(x, ..., y, ...)` instead of
|
39
|
+
# `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
|
40
|
+
Performance/DoubleStartEndWith:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
# Identifies usages of map { ... }.flatten and change them to use
|
44
|
+
# flat_map { ... } instead.
|
45
|
+
Performance/FlatMap:
|
46
|
+
Enabled: true
|
47
|
+
EnabledForFlattenWithoutParams: true
|
48
|
+
|
49
|
+
# This cop identifies places where map { … }.compact can be replaced by
|
50
|
+
# filter_map.
|
51
|
+
Performance/MapCompact:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Performance/MethodObjectAsBlock: # (new in 1.9)
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
# Superseded by Style/OpenStructUse
|
58
|
+
Performance/OpenStruct:
|
59
|
+
Enabled: false
|
60
|
+
|
61
|
+
# Use `Range#cover?` instead of `Range#include?`.
|
62
|
+
Performance/RangeInclude:
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
# This cop identifies the use of a `&block` parameter and `block.call`
|
66
|
+
# where `yield` would do just as well.
|
67
|
+
Performance/RedundantBlockCall:
|
68
|
+
Enabled: true
|
69
|
+
|
70
|
+
# Checks for uses Enumerable#all?, Enumerable#any?, Enumerable#one?, and
|
71
|
+
# Enumerable#none? are compared with === or similar methods in block.
|
72
|
+
Performance/RedundantEqualityComparisonBlock:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
# This cop identifies use of `Regexp#match` or `String#match in a context
|
76
|
+
# where the integral return value of `=~` would do just as well.
|
77
|
+
Performance/RedundantMatch:
|
78
|
+
Enabled: true
|
79
|
+
|
80
|
+
# This cop identifies places where `Hash#merge!` can be replaced by
|
81
|
+
# `Hash#[]=`.
|
82
|
+
Performance/RedundantMerge:
|
83
|
+
Enabled: true
|
84
|
+
MaxKeyValuePairs: 1
|
85
|
+
|
86
|
+
# Identifies places where sort { |a, b| a <=> b } can be replaced with sort.
|
87
|
+
# https://docs.rubocop.org/rubocop-performance/1.7/cops_performance.html#performanceredundantsortblock
|
88
|
+
Performance/RedundantSortBlock:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
# Checks for redundant String#chars.
|
92
|
+
# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performanceredundantstringchars
|
93
|
+
Performance/RedundantStringChars:
|
94
|
+
Enabled: true
|
95
|
+
|
96
|
+
# Identifies places where split argument can be replaced from a deterministic
|
97
|
+
# regexp to a string.
|
98
|
+
Performance/RedundantSplitRegexpArgument:
|
99
|
+
Enabled: true
|
100
|
+
|
101
|
+
# Identifies places where reverse.first(n) and reverse.first can be replaced by last(n).reverse and last.
|
102
|
+
# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancereversefirst
|
103
|
+
Performance/ReverseFirst:
|
104
|
+
Enabled: true
|
105
|
+
|
106
|
+
# Identifies places where sort { |a, b| b <=> a } can be replaced by a faster sort.reverse.
|
107
|
+
# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancesortreverse
|
108
|
+
Performance/SortReverse:
|
109
|
+
Enabled: true
|
110
|
+
|
111
|
+
# Identifies places where gsub(/a+/, 'a') and gsub!(/a+/, 'a') can be replaced by squeeze('a') and squeeze!('a').
|
112
|
+
# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancesqueeze
|
113
|
+
Performance/Squeeze:
|
114
|
+
Enabled: true
|
115
|
+
|
116
|
+
# Use `start_with?` instead of a regex match anchored to the beginning of a
|
117
|
+
# string.
|
118
|
+
Performance/StartWith:
|
119
|
+
Enabled: true
|
120
|
+
|
121
|
+
# Identifies unnecessary use of a regex where String#include? would suffice.
|
122
|
+
# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancestringinclude
|
123
|
+
Performance/StringInclude:
|
124
|
+
Enabled: true
|
125
|
+
|
126
|
+
# Identifies places where string identifier argument can be replaced by symbol
|
127
|
+
# identifier argument. It prevents the redundancy of the internal
|
128
|
+
# string-to-symbol conversion.
|
129
|
+
Performance/StringIdentifierArgument:
|
130
|
+
Enabled: true
|
131
|
+
|
132
|
+
# Use `tr` instead of `gsub` when you are replacing the same number of
|
133
|
+
# characters. Use `delete` instead of `gsub` when you are deleting
|
134
|
+
# characters.
|
135
|
+
Performance/StringReplacement:
|
136
|
+
Enabled: true
|
137
|
+
|
138
|
+
# Identifies places where custom code finding the sum of elements in some
|
139
|
+
# Enumerable object can be replaced by Enumerable#sum method.
|
140
|
+
# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancesum
|
141
|
+
Performance/Sum:
|
142
|
+
Enabled: true
|
143
|
+
|
144
|
+
# Checks for `.times.map` calls.
|
145
|
+
Performance/TimesMap:
|
146
|
+
Enabled: true
|