docquet 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +20 -0
- data/LICENSE +21 -0
- data/README.md +205 -0
- data/config/cops/bundler.yml +19 -0
- data/config/cops/capybara.yml +1 -0
- data/config/cops/capybara_rspec.yml +1 -0
- data/config/cops/gemspec.yml +4 -0
- data/config/cops/i18n_gettext.yml +2 -0
- data/config/cops/i18n_railsi18n.yml +1 -0
- data/config/cops/layout.yml +79 -0
- data/config/cops/lint.yml +7 -0
- data/config/cops/metrics.yml +14 -0
- data/config/cops/migration.yml +2 -0
- data/config/cops/naming.yml +4 -0
- data/config/cops/performance.yml +7 -0
- data/config/cops/rake.yml +5 -0
- data/config/cops/rspec.yml +41 -0
- data/config/cops/security.yml +1 -0
- data/config/cops/sequel.yml +2 -0
- data/config/cops/style.yml +153 -0
- data/config/cops/thread_safety.yml +5 -0
- data/config/defaults/bundler.yml +97 -0
- data/config/defaults/capybara.yml +103 -0
- data/config/defaults/capybara_rspec.yml +24 -0
- data/config/defaults/gemspec.yml +121 -0
- data/config/defaults/i18n_gettext.yml +20 -0
- data/config/defaults/i18n_railsi18n.yml +9 -0
- data/config/defaults/layout.yml +1121 -0
- data/config/defaults/lint.yml +1315 -0
- data/config/defaults/metrics.yml +119 -0
- data/config/defaults/migration.yml +9 -0
- data/config/defaults/naming.yml +332 -0
- data/config/defaults/performance.yml +445 -0
- data/config/defaults/rake.yml +34 -0
- data/config/defaults/rspec.yml +1081 -0
- data/config/defaults/security.yml +67 -0
- data/config/defaults/sequel.yml +59 -0
- data/config/defaults/style.yml +2985 -0
- data/config/defaults/thread_safety.yml +45 -0
- data/exe/docquet +7 -0
- data/lib/docquet/cli/base.rb +21 -0
- data/lib/docquet/cli/install_config.rb +75 -0
- data/lib/docquet/cli/regenerate_todo.rb +46 -0
- data/lib/docquet/cli.rb +6 -0
- data/lib/docquet/commands.rb +12 -0
- data/lib/docquet/config_processor.rb +52 -0
- data/lib/docquet/generators/rubocop_yml_generator.rb +78 -0
- data/lib/docquet/inflector.rb +22 -0
- data/lib/docquet/plugin_detector.rb +29 -0
- data/lib/docquet/rake_task.rb +126 -0
- data/lib/docquet/version.rb +6 -0
- data/lib/docquet.rb +17 -0
- data/templates/rubocop.yml.erb +35 -0
- metadata +172 -0
|
@@ -0,0 +1,2985 @@
|
|
|
1
|
+
# Department 'Style' (282):
|
|
2
|
+
# Supports --autocorrect
|
|
3
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleaccessmodifierdeclarations
|
|
4
|
+
Style/AccessModifierDeclarations:
|
|
5
|
+
Description: Checks style of how access modifiers are used.
|
|
6
|
+
Enabled: true
|
|
7
|
+
VersionAdded: '0.57'
|
|
8
|
+
VersionChanged: '1.70'
|
|
9
|
+
EnforcedStyle: group
|
|
10
|
+
SupportedStyles:
|
|
11
|
+
- inline
|
|
12
|
+
- group
|
|
13
|
+
AllowModifiersOnSymbols: true
|
|
14
|
+
AllowModifiersOnAttrs: true
|
|
15
|
+
AllowModifiersOnAliasMethod: true
|
|
16
|
+
SafeAutoCorrect: false
|
|
17
|
+
|
|
18
|
+
# Supports --autocorrect
|
|
19
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleaccessorgrouping
|
|
20
|
+
Style/AccessorGrouping:
|
|
21
|
+
Description: Checks for grouping of accessors in `class` and `module` bodies.
|
|
22
|
+
Enabled: true
|
|
23
|
+
VersionAdded: '0.87'
|
|
24
|
+
EnforcedStyle: grouped
|
|
25
|
+
SupportedStyles:
|
|
26
|
+
- separated
|
|
27
|
+
- grouped
|
|
28
|
+
|
|
29
|
+
# Supports --autocorrect
|
|
30
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylealias
|
|
31
|
+
Style/Alias:
|
|
32
|
+
Description: Use alias instead of alias_method.
|
|
33
|
+
StyleGuide: "#alias-method-lexically"
|
|
34
|
+
Enabled: true
|
|
35
|
+
VersionAdded: '0.9'
|
|
36
|
+
VersionChanged: '0.36'
|
|
37
|
+
EnforcedStyle: prefer_alias
|
|
38
|
+
SupportedStyles:
|
|
39
|
+
- prefer_alias
|
|
40
|
+
- prefer_alias_method
|
|
41
|
+
|
|
42
|
+
# Supports --autocorrect
|
|
43
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleambiguousendlessmethoddefinition
|
|
44
|
+
Style/AmbiguousEndlessMethodDefinition:
|
|
45
|
+
Description: Checks for endless methods inside operators of lower precedence.
|
|
46
|
+
StyleGuide: "#ambiguous-endless-method-defintions"
|
|
47
|
+
Enabled: true # was pending
|
|
48
|
+
VersionAdded: '1.68'
|
|
49
|
+
|
|
50
|
+
# Supports --autocorrect
|
|
51
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleandor
|
|
52
|
+
Style/AndOr:
|
|
53
|
+
Description: Use &&/|| instead of and/or.
|
|
54
|
+
StyleGuide: "#no-and-or-or"
|
|
55
|
+
Enabled: true
|
|
56
|
+
SafeAutoCorrect: false
|
|
57
|
+
VersionAdded: '0.9'
|
|
58
|
+
VersionChanged: '1.21'
|
|
59
|
+
EnforcedStyle: conditionals
|
|
60
|
+
SupportedStyles:
|
|
61
|
+
- always
|
|
62
|
+
- conditionals
|
|
63
|
+
|
|
64
|
+
# Supports --autocorrect
|
|
65
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleargumentsforwarding
|
|
66
|
+
Style/ArgumentsForwarding:
|
|
67
|
+
Description: Use arguments forwarding.
|
|
68
|
+
StyleGuide: "#arguments-forwarding"
|
|
69
|
+
Enabled: true # was pending
|
|
70
|
+
UseAnonymousForwarding: true
|
|
71
|
+
RedundantRestArgumentNames:
|
|
72
|
+
- args
|
|
73
|
+
- arguments
|
|
74
|
+
RedundantKeywordRestArgumentNames:
|
|
75
|
+
- kwargs
|
|
76
|
+
- options
|
|
77
|
+
- opts
|
|
78
|
+
RedundantBlockArgumentNames:
|
|
79
|
+
- blk
|
|
80
|
+
- block
|
|
81
|
+
- proc
|
|
82
|
+
VersionAdded: '1.1'
|
|
83
|
+
VersionChanged: '1.58'
|
|
84
|
+
|
|
85
|
+
# Supports --autocorrect
|
|
86
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylearraycoercion
|
|
87
|
+
Style/ArrayCoercion:
|
|
88
|
+
Description: Use Array() instead of explicit Array check or [*var], when dealing with
|
|
89
|
+
a variable you want to treat as an Array, but you're not certain it's an array.
|
|
90
|
+
StyleGuide: "#array-coercion"
|
|
91
|
+
Safe: false
|
|
92
|
+
Enabled: true # was false
|
|
93
|
+
VersionAdded: '0.88'
|
|
94
|
+
|
|
95
|
+
# Supports --autocorrect
|
|
96
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylearrayfirstlast
|
|
97
|
+
Style/ArrayFirstLast:
|
|
98
|
+
Description: Use `arr.first` and `arr.last` instead of `arr[0]` and `arr[-1]`.
|
|
99
|
+
References:
|
|
100
|
+
- "#first-and-last"
|
|
101
|
+
Enabled: true # was false
|
|
102
|
+
VersionAdded: '1.58'
|
|
103
|
+
Safe: false
|
|
104
|
+
|
|
105
|
+
# Supports --autocorrect
|
|
106
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylearrayintersect
|
|
107
|
+
Style/ArrayIntersect:
|
|
108
|
+
Description: Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`.
|
|
109
|
+
Enabled: true # was pending
|
|
110
|
+
Safe: false
|
|
111
|
+
VersionAdded: '1.40'
|
|
112
|
+
|
|
113
|
+
# Supports --autocorrect
|
|
114
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylearrayintersectwithsingleelement
|
|
115
|
+
Style/ArrayIntersectWithSingleElement:
|
|
116
|
+
Description: Use `include?(element)` instead of `intersect?([element])`.
|
|
117
|
+
Enabled: true # was pending
|
|
118
|
+
Safe: false
|
|
119
|
+
VersionAdded: '1.81'
|
|
120
|
+
|
|
121
|
+
# Supports --autocorrect
|
|
122
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylearrayjoin
|
|
123
|
+
Style/ArrayJoin:
|
|
124
|
+
Description: Use Array#join instead of Array#*.
|
|
125
|
+
StyleGuide: "#array-join"
|
|
126
|
+
Enabled: true
|
|
127
|
+
VersionAdded: '0.20'
|
|
128
|
+
VersionChanged: '0.31'
|
|
129
|
+
|
|
130
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleasciicomments
|
|
131
|
+
Style/AsciiComments:
|
|
132
|
+
Description: Use only ascii symbols in comments.
|
|
133
|
+
StyleGuide: "#english-comments"
|
|
134
|
+
Enabled: true # was false
|
|
135
|
+
VersionAdded: '0.9'
|
|
136
|
+
VersionChanged: '1.21'
|
|
137
|
+
AllowedChars:
|
|
138
|
+
- "©"
|
|
139
|
+
|
|
140
|
+
# Supports --autocorrect
|
|
141
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleattr
|
|
142
|
+
Style/Attr:
|
|
143
|
+
Description: Checks for uses of Module#attr.
|
|
144
|
+
StyleGuide: "#attr"
|
|
145
|
+
Enabled: true
|
|
146
|
+
VersionAdded: '0.9'
|
|
147
|
+
VersionChanged: '0.12'
|
|
148
|
+
|
|
149
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleautoresourcecleanup
|
|
150
|
+
Style/AutoResourceCleanup:
|
|
151
|
+
Description: Suggests the usage of an auto resource cleanup version of a method (if
|
|
152
|
+
available).
|
|
153
|
+
Enabled: true # was false
|
|
154
|
+
VersionAdded: '0.30'
|
|
155
|
+
|
|
156
|
+
# Supports --autocorrect
|
|
157
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylebarepercentliterals
|
|
158
|
+
Style/BarePercentLiterals:
|
|
159
|
+
Description: Checks if usage of %() or %Q() matches configuration.
|
|
160
|
+
StyleGuide: "#percent-q-shorthand"
|
|
161
|
+
Enabled: true
|
|
162
|
+
VersionAdded: '0.25'
|
|
163
|
+
EnforcedStyle: bare_percent
|
|
164
|
+
SupportedStyles:
|
|
165
|
+
- percent_q
|
|
166
|
+
- bare_percent
|
|
167
|
+
|
|
168
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylebeginblock
|
|
169
|
+
Style/BeginBlock:
|
|
170
|
+
Description: Avoid the use of BEGIN blocks.
|
|
171
|
+
StyleGuide: "#no-BEGIN-blocks"
|
|
172
|
+
Enabled: true
|
|
173
|
+
VersionAdded: '0.9'
|
|
174
|
+
|
|
175
|
+
# Supports --autocorrect
|
|
176
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylebisectedattraccessor
|
|
177
|
+
Style/BisectedAttrAccessor:
|
|
178
|
+
Description: Checks for places where `attr_reader` and `attr_writer` for the same
|
|
179
|
+
method can be combined into single `attr_accessor`.
|
|
180
|
+
Enabled: true
|
|
181
|
+
VersionAdded: '0.87'
|
|
182
|
+
|
|
183
|
+
# Supports --autocorrect
|
|
184
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylebitwisepredicate
|
|
185
|
+
Style/BitwisePredicate:
|
|
186
|
+
Description: Prefer bitwise predicate methods over direct comparison operations.
|
|
187
|
+
StyleGuide: "#bitwise-predicate-methods"
|
|
188
|
+
Enabled: true # was pending
|
|
189
|
+
Safe: false
|
|
190
|
+
VersionAdded: '1.68'
|
|
191
|
+
|
|
192
|
+
# Supports --autocorrect
|
|
193
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleblockcomments
|
|
194
|
+
Style/BlockComments:
|
|
195
|
+
Description: Do not use block comments.
|
|
196
|
+
StyleGuide: "#no-block-comments"
|
|
197
|
+
Enabled: true
|
|
198
|
+
VersionAdded: '0.9'
|
|
199
|
+
VersionChanged: '0.23'
|
|
200
|
+
|
|
201
|
+
# Supports --autocorrect
|
|
202
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleblockdelimiters
|
|
203
|
+
Style/BlockDelimiters:
|
|
204
|
+
Description: Avoid using {...} for multi-line blocks (multiline chaining is always
|
|
205
|
+
ugly). Prefer {...} over do...end for single-line blocks.
|
|
206
|
+
StyleGuide: "#single-line-blocks"
|
|
207
|
+
Enabled: true
|
|
208
|
+
VersionAdded: '0.30'
|
|
209
|
+
VersionChanged: '0.35'
|
|
210
|
+
EnforcedStyle: line_count_based
|
|
211
|
+
SupportedStyles:
|
|
212
|
+
- line_count_based
|
|
213
|
+
- semantic
|
|
214
|
+
- braces_for_chaining
|
|
215
|
+
- always_braces
|
|
216
|
+
ProceduralMethods:
|
|
217
|
+
- benchmark
|
|
218
|
+
- bm
|
|
219
|
+
- bmbm
|
|
220
|
+
- create
|
|
221
|
+
- each_with_object
|
|
222
|
+
- measure
|
|
223
|
+
- new
|
|
224
|
+
- realtime
|
|
225
|
+
- tap
|
|
226
|
+
- with_object
|
|
227
|
+
FunctionalMethods:
|
|
228
|
+
- let
|
|
229
|
+
- let!
|
|
230
|
+
- subject
|
|
231
|
+
- watch
|
|
232
|
+
AllowedMethods:
|
|
233
|
+
- lambda
|
|
234
|
+
- proc
|
|
235
|
+
- it
|
|
236
|
+
AllowedPatterns: []
|
|
237
|
+
AllowBracesOnProceduralOneLiners: false
|
|
238
|
+
BracesRequiredMethods: []
|
|
239
|
+
|
|
240
|
+
# Supports --autocorrect
|
|
241
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecaseequality
|
|
242
|
+
Style/CaseEquality:
|
|
243
|
+
Description: Avoid explicit use of the case equality operator(===).
|
|
244
|
+
StyleGuide: "#no-case-equality"
|
|
245
|
+
Enabled: true
|
|
246
|
+
VersionAdded: '0.9'
|
|
247
|
+
VersionChanged: '0.89'
|
|
248
|
+
AllowOnConstant: false
|
|
249
|
+
AllowOnSelfClass: false
|
|
250
|
+
|
|
251
|
+
# Supports --autocorrect
|
|
252
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecaselikeif
|
|
253
|
+
Style/CaseLikeIf:
|
|
254
|
+
Description: Identifies places where `if-elsif` constructions can be replaced with
|
|
255
|
+
`case-when`.
|
|
256
|
+
StyleGuide: "#case-vs-if-else"
|
|
257
|
+
Enabled: true
|
|
258
|
+
Safe: false
|
|
259
|
+
VersionAdded: '0.88'
|
|
260
|
+
VersionChanged: '1.48'
|
|
261
|
+
MinBranchesCount: 3
|
|
262
|
+
|
|
263
|
+
# Supports --autocorrect
|
|
264
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecharacterliteral
|
|
265
|
+
Style/CharacterLiteral:
|
|
266
|
+
Description: Checks for uses of character literals.
|
|
267
|
+
StyleGuide: "#no-character-literals"
|
|
268
|
+
Enabled: true
|
|
269
|
+
VersionAdded: '0.9'
|
|
270
|
+
|
|
271
|
+
# Supports --autocorrect
|
|
272
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleclassandmodulechildren
|
|
273
|
+
Style/ClassAndModuleChildren:
|
|
274
|
+
Description: Checks style of children classes and modules.
|
|
275
|
+
StyleGuide: "#namespace-definition"
|
|
276
|
+
SafeAutoCorrect: false
|
|
277
|
+
Enabled: true
|
|
278
|
+
VersionAdded: '0.19'
|
|
279
|
+
VersionChanged: '1.74'
|
|
280
|
+
EnforcedStyle: nested
|
|
281
|
+
SupportedStyles:
|
|
282
|
+
- nested
|
|
283
|
+
- compact
|
|
284
|
+
EnforcedStyleForClasses:
|
|
285
|
+
SupportedStylesForClasses:
|
|
286
|
+
-
|
|
287
|
+
- nested
|
|
288
|
+
- compact
|
|
289
|
+
EnforcedStyleForModules:
|
|
290
|
+
SupportedStylesForModules:
|
|
291
|
+
-
|
|
292
|
+
- nested
|
|
293
|
+
- compact
|
|
294
|
+
|
|
295
|
+
# Supports --autocorrect
|
|
296
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleclasscheck
|
|
297
|
+
Style/ClassCheck:
|
|
298
|
+
Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
|
|
299
|
+
StyleGuide: "#is-a-vs-kind-of"
|
|
300
|
+
Enabled: true
|
|
301
|
+
VersionAdded: '0.24'
|
|
302
|
+
EnforcedStyle: is_a?
|
|
303
|
+
SupportedStyles:
|
|
304
|
+
- is_a?
|
|
305
|
+
- kind_of?
|
|
306
|
+
|
|
307
|
+
# Supports --autocorrect
|
|
308
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleclassequalitycomparison
|
|
309
|
+
Style/ClassEqualityComparison:
|
|
310
|
+
Description: Enforces the use of `Object#instance_of?` instead of class comparison
|
|
311
|
+
for equality.
|
|
312
|
+
StyleGuide: "#instance-of-vs-class-comparison"
|
|
313
|
+
Enabled: true
|
|
314
|
+
SafeAutoCorrect: false
|
|
315
|
+
VersionAdded: '0.93'
|
|
316
|
+
VersionChanged: '1.57'
|
|
317
|
+
AllowedMethods:
|
|
318
|
+
- "=="
|
|
319
|
+
- equal?
|
|
320
|
+
- eql?
|
|
321
|
+
AllowedPatterns: []
|
|
322
|
+
|
|
323
|
+
# Supports --autocorrect
|
|
324
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleclassmethods
|
|
325
|
+
Style/ClassMethods:
|
|
326
|
+
Description: Use self when defining module/class methods.
|
|
327
|
+
StyleGuide: "#def-self-class-methods"
|
|
328
|
+
Enabled: true
|
|
329
|
+
VersionAdded: '0.9'
|
|
330
|
+
VersionChanged: '0.20'
|
|
331
|
+
|
|
332
|
+
# Supports --autocorrect
|
|
333
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleclassmethodsdefinitions
|
|
334
|
+
Style/ClassMethodsDefinitions:
|
|
335
|
+
Description: Enforces using `def self.method_name` or `class << self` to define class
|
|
336
|
+
methods.
|
|
337
|
+
StyleGuide: "#def-self-class-methods"
|
|
338
|
+
Enabled: true # was false
|
|
339
|
+
VersionAdded: '0.89'
|
|
340
|
+
EnforcedStyle: def_self
|
|
341
|
+
SupportedStyles:
|
|
342
|
+
- def_self
|
|
343
|
+
- self_class
|
|
344
|
+
|
|
345
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleclassvars
|
|
346
|
+
Style/ClassVars:
|
|
347
|
+
Description: Avoid the use of class variables.
|
|
348
|
+
StyleGuide: "#no-class-vars"
|
|
349
|
+
Enabled: true
|
|
350
|
+
VersionAdded: '0.13'
|
|
351
|
+
|
|
352
|
+
# Supports --autocorrect
|
|
353
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecollectioncompact
|
|
354
|
+
Style/CollectionCompact:
|
|
355
|
+
Description: Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject
|
|
356
|
+
nils.
|
|
357
|
+
Enabled: true # was pending
|
|
358
|
+
Safe: false
|
|
359
|
+
VersionAdded: '1.2'
|
|
360
|
+
VersionChanged: '1.3'
|
|
361
|
+
AllowedReceivers: []
|
|
362
|
+
|
|
363
|
+
# Supports --autocorrect
|
|
364
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecollectionmethods
|
|
365
|
+
Style/CollectionMethods:
|
|
366
|
+
Description: Preferred collection methods.
|
|
367
|
+
StyleGuide: "#map-find-select-reduce-include-size"
|
|
368
|
+
Enabled: true # was false
|
|
369
|
+
VersionAdded: '0.9'
|
|
370
|
+
VersionChanged: '1.7'
|
|
371
|
+
Safe: false
|
|
372
|
+
PreferredMethods:
|
|
373
|
+
collect: map
|
|
374
|
+
collect!: map!
|
|
375
|
+
collect_concat: flat_map
|
|
376
|
+
inject: reduce
|
|
377
|
+
detect: find
|
|
378
|
+
find_all: select
|
|
379
|
+
member?: include?
|
|
380
|
+
MethodsAcceptingSymbol:
|
|
381
|
+
- inject
|
|
382
|
+
- reduce
|
|
383
|
+
|
|
384
|
+
# Supports --autocorrect
|
|
385
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecollectionquerying
|
|
386
|
+
Style/CollectionQuerying:
|
|
387
|
+
Description: Prefer `Enumerable` predicate methods over expressions with `count`.
|
|
388
|
+
StyleGuide: "#collection-querying"
|
|
389
|
+
Enabled: true # was pending
|
|
390
|
+
VersionAdded: '1.77'
|
|
391
|
+
Safe: false
|
|
392
|
+
|
|
393
|
+
# Supports --autocorrect
|
|
394
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecolonmethodcall
|
|
395
|
+
Style/ColonMethodCall:
|
|
396
|
+
Description: 'Do not use :: for method call.'
|
|
397
|
+
StyleGuide: "#double-colons"
|
|
398
|
+
Enabled: true
|
|
399
|
+
VersionAdded: '0.9'
|
|
400
|
+
|
|
401
|
+
# Supports --autocorrect
|
|
402
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecolonmethoddefinition
|
|
403
|
+
Style/ColonMethodDefinition:
|
|
404
|
+
Description: 'Do not use :: for defining class methods.'
|
|
405
|
+
StyleGuide: "#colon-method-definition"
|
|
406
|
+
Enabled: true
|
|
407
|
+
VersionAdded: '0.52'
|
|
408
|
+
|
|
409
|
+
# Supports --autocorrect
|
|
410
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecombinabledefined
|
|
411
|
+
Style/CombinableDefined:
|
|
412
|
+
Description: Checks successive `defined?` calls that can be combined into a single
|
|
413
|
+
call.
|
|
414
|
+
Enabled: true # was pending
|
|
415
|
+
VersionAdded: '1.68'
|
|
416
|
+
|
|
417
|
+
# Supports --autocorrect
|
|
418
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecombinableloops
|
|
419
|
+
Style/CombinableLoops:
|
|
420
|
+
Description: Checks for places where multiple consecutive loops over the same data
|
|
421
|
+
can be combined into a single loop.
|
|
422
|
+
Enabled: true
|
|
423
|
+
Safe: false
|
|
424
|
+
VersionAdded: '0.90'
|
|
425
|
+
|
|
426
|
+
# Supports --autocorrect
|
|
427
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecommandliteral
|
|
428
|
+
Style/CommandLiteral:
|
|
429
|
+
Description: Use `` or %x around command literals.
|
|
430
|
+
StyleGuide: "#percent-x"
|
|
431
|
+
Enabled: true
|
|
432
|
+
VersionAdded: '0.30'
|
|
433
|
+
EnforcedStyle: backticks
|
|
434
|
+
SupportedStyles:
|
|
435
|
+
- backticks
|
|
436
|
+
- percent_x
|
|
437
|
+
- mixed
|
|
438
|
+
AllowInnerBackticks: false
|
|
439
|
+
|
|
440
|
+
# Supports --autocorrect
|
|
441
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecommentannotation
|
|
442
|
+
Style/CommentAnnotation:
|
|
443
|
+
Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW,
|
|
444
|
+
NOTE).
|
|
445
|
+
StyleGuide: "#annotate-keywords"
|
|
446
|
+
Enabled: true
|
|
447
|
+
VersionAdded: '0.10'
|
|
448
|
+
VersionChanged: '1.20'
|
|
449
|
+
Keywords:
|
|
450
|
+
- TODO
|
|
451
|
+
- FIXME
|
|
452
|
+
- OPTIMIZE
|
|
453
|
+
- HACK
|
|
454
|
+
- REVIEW
|
|
455
|
+
- NOTE
|
|
456
|
+
RequireColon: true
|
|
457
|
+
|
|
458
|
+
# Supports --autocorrect
|
|
459
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecommentedkeyword
|
|
460
|
+
Style/CommentedKeyword:
|
|
461
|
+
Description: Do not place comments on the same line as certain keywords.
|
|
462
|
+
Enabled: true
|
|
463
|
+
SafeAutoCorrect: false
|
|
464
|
+
VersionAdded: '0.51'
|
|
465
|
+
VersionChanged: '1.19'
|
|
466
|
+
|
|
467
|
+
# Supports --autocorrect
|
|
468
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecomparablebetween
|
|
469
|
+
Style/ComparableBetween:
|
|
470
|
+
Description: Enforces the use of `Comparable#between?` instead of logical comparison.
|
|
471
|
+
Enabled: true # was pending
|
|
472
|
+
Safe: false
|
|
473
|
+
VersionAdded: '1.74'
|
|
474
|
+
VersionChanged: '1.75'
|
|
475
|
+
StyleGuide: "#ranges-or-between"
|
|
476
|
+
|
|
477
|
+
# Supports --autocorrect
|
|
478
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecomparableclamp
|
|
479
|
+
Style/ComparableClamp:
|
|
480
|
+
Description: Enforces the use of `Comparable#clamp` instead of comparison by minimum
|
|
481
|
+
and maximum.
|
|
482
|
+
Enabled: true # was pending
|
|
483
|
+
VersionAdded: '1.44'
|
|
484
|
+
|
|
485
|
+
# Supports --autocorrect
|
|
486
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleconcatarrayliterals
|
|
487
|
+
Style/ConcatArrayLiterals:
|
|
488
|
+
Description: Enforces the use of `Array#push(item)` instead of `Array#concat([item])`
|
|
489
|
+
to avoid redundant array literals.
|
|
490
|
+
Enabled: true # was pending
|
|
491
|
+
Safe: false
|
|
492
|
+
VersionAdded: '1.41'
|
|
493
|
+
|
|
494
|
+
# Supports --autocorrect
|
|
495
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleconditionalassignment
|
|
496
|
+
Style/ConditionalAssignment:
|
|
497
|
+
Description: Use the return value of `if` and `case` statements for assignment to
|
|
498
|
+
a variable and variable comparison instead of assigning that variable inside of
|
|
499
|
+
each branch.
|
|
500
|
+
Enabled: true
|
|
501
|
+
VersionAdded: '0.36'
|
|
502
|
+
VersionChanged: '0.47'
|
|
503
|
+
EnforcedStyle: assign_to_condition
|
|
504
|
+
SupportedStyles:
|
|
505
|
+
- assign_to_condition
|
|
506
|
+
- assign_inside_condition
|
|
507
|
+
SingleLineConditionsOnly: true
|
|
508
|
+
IncludeTernaryExpressions: true
|
|
509
|
+
|
|
510
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleconstantvisibility
|
|
511
|
+
Style/ConstantVisibility:
|
|
512
|
+
Description: Check that class- and module constants have visibility declarations.
|
|
513
|
+
Enabled: true # was false
|
|
514
|
+
VersionAdded: '0.66'
|
|
515
|
+
VersionChanged: '1.10'
|
|
516
|
+
IgnoreModules: false
|
|
517
|
+
|
|
518
|
+
# Supports --autocorrect
|
|
519
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylecopyright
|
|
520
|
+
Style/Copyright:
|
|
521
|
+
Description: Include a copyright notice in each file before any code.
|
|
522
|
+
Enabled: true # was false
|
|
523
|
+
VersionAdded: '0.30'
|
|
524
|
+
Notice: "^Copyright (\\(c\\) )?2[0-9]{3} .+"
|
|
525
|
+
AutocorrectNotice: ''
|
|
526
|
+
|
|
527
|
+
# Supports --autocorrect
|
|
528
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledatainheritance
|
|
529
|
+
Style/DataInheritance:
|
|
530
|
+
Description: Checks for inheritance from Data.define.
|
|
531
|
+
StyleGuide: "#no-extend-data-define"
|
|
532
|
+
Enabled: true # was pending
|
|
533
|
+
SafeAutoCorrect: false
|
|
534
|
+
VersionAdded: '1.49'
|
|
535
|
+
VersionChanged: '1.51'
|
|
536
|
+
|
|
537
|
+
# Supports --autocorrect
|
|
538
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledatetime
|
|
539
|
+
Style/DateTime:
|
|
540
|
+
Description: Use Time over DateTime.
|
|
541
|
+
StyleGuide: "#date-time"
|
|
542
|
+
Enabled: true # was false
|
|
543
|
+
VersionAdded: '0.51'
|
|
544
|
+
VersionChanged: '0.92'
|
|
545
|
+
SafeAutoCorrect: false
|
|
546
|
+
AllowCoercion: false
|
|
547
|
+
|
|
548
|
+
# Supports --autocorrect
|
|
549
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledefwithparentheses
|
|
550
|
+
Style/DefWithParentheses:
|
|
551
|
+
Description: Use def with parentheses when there are arguments.
|
|
552
|
+
StyleGuide: "#method-parens"
|
|
553
|
+
Enabled: true
|
|
554
|
+
VersionAdded: '0.9'
|
|
555
|
+
VersionChanged: '0.12'
|
|
556
|
+
|
|
557
|
+
# Supports --autocorrect
|
|
558
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledigchain
|
|
559
|
+
Style/DigChain:
|
|
560
|
+
Description: Use `dig` with multiple parameters instead of chaining multiple calls.
|
|
561
|
+
Enabled: true # was pending
|
|
562
|
+
Safe: false
|
|
563
|
+
VersionAdded: '1.69'
|
|
564
|
+
|
|
565
|
+
# Supports --autocorrect
|
|
566
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledir
|
|
567
|
+
Style/Dir:
|
|
568
|
+
Description: Use the `__dir__` method to retrieve the canonicalized absolute path
|
|
569
|
+
to the current file.
|
|
570
|
+
Enabled: true
|
|
571
|
+
VersionAdded: '0.50'
|
|
572
|
+
|
|
573
|
+
# Supports --autocorrect
|
|
574
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledirempty
|
|
575
|
+
Style/DirEmpty:
|
|
576
|
+
Description: Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory
|
|
577
|
+
is empty.
|
|
578
|
+
Enabled: true # was pending
|
|
579
|
+
VersionAdded: '1.48'
|
|
580
|
+
|
|
581
|
+
# Supports --autocorrect
|
|
582
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledisablecopswithinsourcecodedirective
|
|
583
|
+
Style/DisableCopsWithinSourceCodeDirective:
|
|
584
|
+
Description: Forbids disabling/enabling cops within source code.
|
|
585
|
+
Enabled: true # was false
|
|
586
|
+
VersionAdded: '0.82'
|
|
587
|
+
VersionChanged: '1.9'
|
|
588
|
+
AllowedCops: []
|
|
589
|
+
|
|
590
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledocumentdynamicevaldefinition
|
|
591
|
+
Style/DocumentDynamicEvalDefinition:
|
|
592
|
+
Description: When using `class_eval` (or other `eval`) with string interpolation,
|
|
593
|
+
add a comment block showing its appearance if interpolated.
|
|
594
|
+
StyleGuide: "#eval-comment-docs"
|
|
595
|
+
Enabled: true # was pending
|
|
596
|
+
VersionAdded: '1.1'
|
|
597
|
+
VersionChanged: '1.3'
|
|
598
|
+
|
|
599
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledocumentation
|
|
600
|
+
Style/Documentation:
|
|
601
|
+
Description: Document classes and non-namespace modules.
|
|
602
|
+
Enabled: true
|
|
603
|
+
VersionAdded: '0.9'
|
|
604
|
+
AllowedConstants: []
|
|
605
|
+
Exclude:
|
|
606
|
+
- "spec/**/*"
|
|
607
|
+
- "test/**/*"
|
|
608
|
+
|
|
609
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledocumentationmethod
|
|
610
|
+
Style/DocumentationMethod:
|
|
611
|
+
Description: Checks for missing documentation comment for public methods.
|
|
612
|
+
Enabled: true # was false
|
|
613
|
+
VersionAdded: '0.43'
|
|
614
|
+
AllowedMethods: []
|
|
615
|
+
Exclude:
|
|
616
|
+
- "spec/**/*"
|
|
617
|
+
- "test/**/*"
|
|
618
|
+
RequireForNonPublicMethods: false
|
|
619
|
+
|
|
620
|
+
# Supports --autocorrect
|
|
621
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledoublecopdisabledirective
|
|
622
|
+
Style/DoubleCopDisableDirective:
|
|
623
|
+
Description: Checks for double rubocop:disable comments on a single line.
|
|
624
|
+
Enabled: true
|
|
625
|
+
VersionAdded: '0.73'
|
|
626
|
+
|
|
627
|
+
# Supports --autocorrect
|
|
628
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledoublenegation
|
|
629
|
+
Style/DoubleNegation:
|
|
630
|
+
Description: Checks for uses of double negation (!!).
|
|
631
|
+
StyleGuide: "#no-bang-bang"
|
|
632
|
+
Enabled: true
|
|
633
|
+
VersionAdded: '0.19'
|
|
634
|
+
VersionChanged: '1.2'
|
|
635
|
+
EnforcedStyle: allowed_in_returns
|
|
636
|
+
SafeAutoCorrect: false
|
|
637
|
+
SupportedStyles:
|
|
638
|
+
- allowed_in_returns
|
|
639
|
+
- forbidden
|
|
640
|
+
|
|
641
|
+
# Supports --autocorrect
|
|
642
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleeachforsimpleloop
|
|
643
|
+
Style/EachForSimpleLoop:
|
|
644
|
+
Description: Use `Integer#times` for a simple loop which iterates a fixed number of
|
|
645
|
+
times.
|
|
646
|
+
Enabled: true
|
|
647
|
+
VersionAdded: '0.41'
|
|
648
|
+
|
|
649
|
+
# Supports --autocorrect
|
|
650
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleeachwithobject
|
|
651
|
+
Style/EachWithObject:
|
|
652
|
+
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
|
653
|
+
Enabled: true
|
|
654
|
+
VersionAdded: '0.22'
|
|
655
|
+
VersionChanged: '0.42'
|
|
656
|
+
|
|
657
|
+
# Supports --autocorrect
|
|
658
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptyblockparameter
|
|
659
|
+
Style/EmptyBlockParameter:
|
|
660
|
+
Description: Omit pipes for empty block parameters.
|
|
661
|
+
Enabled: true
|
|
662
|
+
VersionAdded: '0.52'
|
|
663
|
+
|
|
664
|
+
# Supports --autocorrect
|
|
665
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptycasecondition
|
|
666
|
+
Style/EmptyCaseCondition:
|
|
667
|
+
Description: Avoid empty condition in case statements.
|
|
668
|
+
Enabled: true
|
|
669
|
+
VersionAdded: '0.40'
|
|
670
|
+
|
|
671
|
+
# Supports --autocorrect
|
|
672
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptyelse
|
|
673
|
+
Style/EmptyElse:
|
|
674
|
+
Description: Avoid empty else-clauses.
|
|
675
|
+
Enabled: true
|
|
676
|
+
AutoCorrect: contextual
|
|
677
|
+
VersionAdded: '0.28'
|
|
678
|
+
VersionChanged: '1.61'
|
|
679
|
+
EnforcedStyle: both
|
|
680
|
+
SupportedStyles:
|
|
681
|
+
- empty
|
|
682
|
+
- nil
|
|
683
|
+
- both
|
|
684
|
+
AllowComments: false
|
|
685
|
+
|
|
686
|
+
# Supports --autocorrect
|
|
687
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptyheredoc
|
|
688
|
+
Style/EmptyHeredoc:
|
|
689
|
+
Description: Checks for using empty heredoc to reduce redundancy.
|
|
690
|
+
Enabled: true # was pending
|
|
691
|
+
AutoCorrect: contextual
|
|
692
|
+
VersionAdded: '1.32'
|
|
693
|
+
VersionChanged: '1.61'
|
|
694
|
+
|
|
695
|
+
# Supports --autocorrect
|
|
696
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptylambdaparameter
|
|
697
|
+
Style/EmptyLambdaParameter:
|
|
698
|
+
Description: Omit parens for empty lambda parameters.
|
|
699
|
+
Enabled: true
|
|
700
|
+
VersionAdded: '0.52'
|
|
701
|
+
|
|
702
|
+
# Supports --autocorrect
|
|
703
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptyliteral
|
|
704
|
+
Style/EmptyLiteral:
|
|
705
|
+
Description: Prefer literals to Array.new/Hash.new/String.new.
|
|
706
|
+
StyleGuide: "#literal-array-hash"
|
|
707
|
+
Enabled: true
|
|
708
|
+
VersionAdded: '0.9'
|
|
709
|
+
VersionChanged: '0.12'
|
|
710
|
+
|
|
711
|
+
# Supports --autocorrect
|
|
712
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptymethod
|
|
713
|
+
Style/EmptyMethod:
|
|
714
|
+
Description: Checks the formatting of empty method definitions.
|
|
715
|
+
StyleGuide: "#no-single-line-methods"
|
|
716
|
+
Enabled: true
|
|
717
|
+
AutoCorrect: contextual
|
|
718
|
+
VersionAdded: '0.46'
|
|
719
|
+
VersionChanged: '1.61'
|
|
720
|
+
EnforcedStyle: compact
|
|
721
|
+
SupportedStyles:
|
|
722
|
+
- compact
|
|
723
|
+
- expanded
|
|
724
|
+
|
|
725
|
+
# Supports --autocorrect
|
|
726
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptystringinsideinterpolation
|
|
727
|
+
Style/EmptyStringInsideInterpolation:
|
|
728
|
+
Description: Checks for empty strings being assigned inside string interpolation.
|
|
729
|
+
StyleGuide: "#empty-strings-in-interpolation"
|
|
730
|
+
Enabled: true # was pending
|
|
731
|
+
EnforcedStyle: trailing_conditional
|
|
732
|
+
SupportedStyles:
|
|
733
|
+
- trailing_conditional
|
|
734
|
+
- ternary
|
|
735
|
+
VersionAdded: '1.76'
|
|
736
|
+
|
|
737
|
+
# Supports --autocorrect
|
|
738
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleencoding
|
|
739
|
+
Style/Encoding:
|
|
740
|
+
Description: Use UTF-8 as the source file encoding.
|
|
741
|
+
StyleGuide: "#utf-8"
|
|
742
|
+
Enabled: true
|
|
743
|
+
VersionAdded: '0.9'
|
|
744
|
+
VersionChanged: '0.50'
|
|
745
|
+
|
|
746
|
+
# Supports --autocorrect
|
|
747
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleendblock
|
|
748
|
+
Style/EndBlock:
|
|
749
|
+
Description: Avoid the use of END blocks.
|
|
750
|
+
StyleGuide: "#no-END-blocks"
|
|
751
|
+
Enabled: true
|
|
752
|
+
VersionAdded: '0.9'
|
|
753
|
+
VersionChanged: '0.81'
|
|
754
|
+
|
|
755
|
+
# Supports --autocorrect
|
|
756
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleendlessmethod
|
|
757
|
+
Style/EndlessMethod:
|
|
758
|
+
Description: Avoid the use of multi-lined endless method definitions.
|
|
759
|
+
StyleGuide: "#endless-methods"
|
|
760
|
+
Enabled: true # was pending
|
|
761
|
+
VersionAdded: '1.8'
|
|
762
|
+
EnforcedStyle: allow_single_line
|
|
763
|
+
SupportedStyles:
|
|
764
|
+
- allow_single_line
|
|
765
|
+
- allow_always
|
|
766
|
+
- disallow
|
|
767
|
+
- require_single_line
|
|
768
|
+
- require_always
|
|
769
|
+
|
|
770
|
+
# Supports --autocorrect
|
|
771
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleenvhome
|
|
772
|
+
Style/EnvHome:
|
|
773
|
+
Description: Checks for consistent usage of `ENV['HOME']`.
|
|
774
|
+
Enabled: true # was pending
|
|
775
|
+
Safe: false
|
|
776
|
+
VersionAdded: '1.29'
|
|
777
|
+
|
|
778
|
+
# Supports --autocorrect
|
|
779
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleevalwithlocation
|
|
780
|
+
Style/EvalWithLocation:
|
|
781
|
+
Description: Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by
|
|
782
|
+
backtraces.
|
|
783
|
+
Enabled: true
|
|
784
|
+
VersionAdded: '0.52'
|
|
785
|
+
|
|
786
|
+
# Supports --autocorrect
|
|
787
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleevenodd
|
|
788
|
+
Style/EvenOdd:
|
|
789
|
+
Description: Favor the use of `Integer#even?` && `Integer#odd?`.
|
|
790
|
+
StyleGuide: "#predicate-methods"
|
|
791
|
+
Enabled: true
|
|
792
|
+
VersionAdded: '0.12'
|
|
793
|
+
VersionChanged: '0.29'
|
|
794
|
+
|
|
795
|
+
# Supports --autocorrect
|
|
796
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleexactregexpmatch
|
|
797
|
+
Style/ExactRegexpMatch:
|
|
798
|
+
Description: Checks for exact regexp match inside Regexp literals.
|
|
799
|
+
Enabled: true # was pending
|
|
800
|
+
VersionAdded: '1.51'
|
|
801
|
+
|
|
802
|
+
# Supports --autocorrect
|
|
803
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleexpandpatharguments
|
|
804
|
+
Style/ExpandPathArguments:
|
|
805
|
+
Description: Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`.
|
|
806
|
+
Enabled: true
|
|
807
|
+
VersionAdded: '0.53'
|
|
808
|
+
|
|
809
|
+
# Supports --autocorrect
|
|
810
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleexplicitblockargument
|
|
811
|
+
Style/ExplicitBlockArgument:
|
|
812
|
+
Description: Consider using explicit block argument to avoid writing block literal
|
|
813
|
+
that just passes its arguments to another block.
|
|
814
|
+
StyleGuide: "#block-argument"
|
|
815
|
+
Enabled: true
|
|
816
|
+
VersionAdded: '0.89'
|
|
817
|
+
VersionChanged: '1.8'
|
|
818
|
+
|
|
819
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleexponentialnotation
|
|
820
|
+
Style/ExponentialNotation:
|
|
821
|
+
Description: When using exponential notation, favor a mantissa between 1 (inclusive)
|
|
822
|
+
and 10 (exclusive).
|
|
823
|
+
StyleGuide: "#exponential-notation"
|
|
824
|
+
Enabled: true
|
|
825
|
+
VersionAdded: '0.82'
|
|
826
|
+
EnforcedStyle: scientific
|
|
827
|
+
SupportedStyles:
|
|
828
|
+
- scientific
|
|
829
|
+
- engineering
|
|
830
|
+
- integral
|
|
831
|
+
|
|
832
|
+
# Supports --autocorrect
|
|
833
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefetchenvvar
|
|
834
|
+
Style/FetchEnvVar:
|
|
835
|
+
Description: Suggests `ENV.fetch` for the replacement of `ENV[]`.
|
|
836
|
+
References:
|
|
837
|
+
- https://rubystyle.guide/#hash-fetch-defaults
|
|
838
|
+
Enabled: true # was pending
|
|
839
|
+
VersionAdded: '1.28'
|
|
840
|
+
AllowedVars: []
|
|
841
|
+
DefaultToNil: true
|
|
842
|
+
|
|
843
|
+
# Supports --autocorrect
|
|
844
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefileempty
|
|
845
|
+
Style/FileEmpty:
|
|
846
|
+
Description: Prefer to use `File.empty?('path/to/file')` when checking if a file is
|
|
847
|
+
empty.
|
|
848
|
+
Enabled: true # was pending
|
|
849
|
+
Safe: false
|
|
850
|
+
VersionAdded: '1.48'
|
|
851
|
+
|
|
852
|
+
# Supports --autocorrect
|
|
853
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefilenull
|
|
854
|
+
Style/FileNull:
|
|
855
|
+
Description: Use `File::NULL` instead of hardcoding "dev/null".
|
|
856
|
+
Enabled: true # was pending
|
|
857
|
+
SafeAutoCorrect: false
|
|
858
|
+
VersionAdded: '1.69'
|
|
859
|
+
|
|
860
|
+
# Supports --autocorrect
|
|
861
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefileread
|
|
862
|
+
Style/FileRead:
|
|
863
|
+
Description: Favor `File.(bin)read` convenience methods.
|
|
864
|
+
StyleGuide: "#file-read"
|
|
865
|
+
Enabled: true # was pending
|
|
866
|
+
VersionAdded: '1.24'
|
|
867
|
+
|
|
868
|
+
# Supports --autocorrect
|
|
869
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefiletouch
|
|
870
|
+
Style/FileTouch:
|
|
871
|
+
Description: Favor `FileUtils.touch` for touching files.
|
|
872
|
+
Enabled: true # was pending
|
|
873
|
+
VersionAdded: '1.69'
|
|
874
|
+
SafeAutoCorrect: false
|
|
875
|
+
|
|
876
|
+
# Supports --autocorrect
|
|
877
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefilewrite
|
|
878
|
+
Style/FileWrite:
|
|
879
|
+
Description: Favor `File.(bin)write` convenience methods.
|
|
880
|
+
StyleGuide: "#file-write"
|
|
881
|
+
Enabled: true # was pending
|
|
882
|
+
VersionAdded: '1.24'
|
|
883
|
+
|
|
884
|
+
# Supports --autocorrect
|
|
885
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefloatdivision
|
|
886
|
+
Style/FloatDivision:
|
|
887
|
+
Description: For performing float division, coerce one side only.
|
|
888
|
+
StyleGuide: "#float-division"
|
|
889
|
+
References:
|
|
890
|
+
- https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html
|
|
891
|
+
Enabled: true
|
|
892
|
+
VersionAdded: '0.72'
|
|
893
|
+
VersionChanged: '1.9'
|
|
894
|
+
Safe: false
|
|
895
|
+
EnforcedStyle: single_coerce
|
|
896
|
+
SupportedStyles:
|
|
897
|
+
- left_coerce
|
|
898
|
+
- right_coerce
|
|
899
|
+
- single_coerce
|
|
900
|
+
- fdiv
|
|
901
|
+
|
|
902
|
+
# Supports --autocorrect
|
|
903
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefor
|
|
904
|
+
Style/For:
|
|
905
|
+
Description: Checks use of for or each in multiline loops.
|
|
906
|
+
StyleGuide: "#no-for-loops"
|
|
907
|
+
Enabled: true
|
|
908
|
+
SafeAutoCorrect: false
|
|
909
|
+
VersionAdded: '0.13'
|
|
910
|
+
VersionChanged: '1.26'
|
|
911
|
+
EnforcedStyle: each
|
|
912
|
+
SupportedStyles:
|
|
913
|
+
- each
|
|
914
|
+
- for
|
|
915
|
+
|
|
916
|
+
# Supports --autocorrect
|
|
917
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleformatstring
|
|
918
|
+
Style/FormatString:
|
|
919
|
+
Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
|
|
920
|
+
StyleGuide: "#sprintf"
|
|
921
|
+
Enabled: true
|
|
922
|
+
VersionAdded: '0.19'
|
|
923
|
+
VersionChanged: '0.49'
|
|
924
|
+
EnforcedStyle: format
|
|
925
|
+
SupportedStyles:
|
|
926
|
+
- format
|
|
927
|
+
- sprintf
|
|
928
|
+
- percent
|
|
929
|
+
|
|
930
|
+
# Supports --autocorrect
|
|
931
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleformatstringtoken
|
|
932
|
+
Style/FormatStringToken:
|
|
933
|
+
Description: Use a consistent style for format string tokens.
|
|
934
|
+
Enabled: true
|
|
935
|
+
EnforcedStyle: annotated
|
|
936
|
+
SupportedStyles:
|
|
937
|
+
- annotated
|
|
938
|
+
- template
|
|
939
|
+
- unannotated
|
|
940
|
+
MaxUnannotatedPlaceholdersAllowed: 1
|
|
941
|
+
Mode: aggressive
|
|
942
|
+
VersionAdded: '0.49'
|
|
943
|
+
VersionChanged: '1.74'
|
|
944
|
+
AllowedMethods: []
|
|
945
|
+
AllowedPatterns: []
|
|
946
|
+
|
|
947
|
+
# Supports --autocorrect
|
|
948
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefrozenstringliteralcomment
|
|
949
|
+
Style/FrozenStringLiteralComment:
|
|
950
|
+
Description: Add the frozen_string_literal comment to the top of files to help transition
|
|
951
|
+
to frozen string literals by default.
|
|
952
|
+
Enabled: true
|
|
953
|
+
VersionAdded: '0.36'
|
|
954
|
+
VersionChanged: '0.79'
|
|
955
|
+
EnforcedStyle: always
|
|
956
|
+
SupportedStyles:
|
|
957
|
+
- always
|
|
958
|
+
- always_true
|
|
959
|
+
- never
|
|
960
|
+
SafeAutoCorrect: false
|
|
961
|
+
Exclude:
|
|
962
|
+
- "**/*.arb"
|
|
963
|
+
|
|
964
|
+
# Supports --autocorrect
|
|
965
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleglobalstdstream
|
|
966
|
+
Style/GlobalStdStream:
|
|
967
|
+
Description: Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.
|
|
968
|
+
StyleGuide: "#global-stdout"
|
|
969
|
+
Enabled: true
|
|
970
|
+
VersionAdded: '0.89'
|
|
971
|
+
SafeAutoCorrect: false
|
|
972
|
+
|
|
973
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleglobalvars
|
|
974
|
+
Style/GlobalVars:
|
|
975
|
+
Description: Do not introduce global variables.
|
|
976
|
+
StyleGuide: "#instance-vars"
|
|
977
|
+
References:
|
|
978
|
+
- https://www.zenspider.com/ruby/quickref.html
|
|
979
|
+
Enabled: true
|
|
980
|
+
VersionAdded: '0.13'
|
|
981
|
+
AllowedVariables: []
|
|
982
|
+
|
|
983
|
+
# Supports --autocorrect
|
|
984
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleguardclause
|
|
985
|
+
Style/GuardClause:
|
|
986
|
+
Description: Checks for conditionals that can be replaced with guard clauses.
|
|
987
|
+
StyleGuide: "#no-nested-conditionals"
|
|
988
|
+
Enabled: true
|
|
989
|
+
VersionAdded: '0.20'
|
|
990
|
+
VersionChanged: '1.31'
|
|
991
|
+
MinBodyLength: 1
|
|
992
|
+
AllowConsecutiveConditionals: false
|
|
993
|
+
|
|
994
|
+
# Supports --autocorrect
|
|
995
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashaslastarrayitem
|
|
996
|
+
Style/HashAsLastArrayItem:
|
|
997
|
+
Description: Checks for presence or absence of braces around hash literal as a last
|
|
998
|
+
array item depending on configuration.
|
|
999
|
+
StyleGuide: "#hash-literal-as-last-array-item"
|
|
1000
|
+
Enabled: true
|
|
1001
|
+
VersionAdded: '0.88'
|
|
1002
|
+
EnforcedStyle: braces
|
|
1003
|
+
SupportedStyles:
|
|
1004
|
+
- braces
|
|
1005
|
+
- no_braces
|
|
1006
|
+
|
|
1007
|
+
# Supports --autocorrect
|
|
1008
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashconversion
|
|
1009
|
+
Style/HashConversion:
|
|
1010
|
+
Description: Avoid Hash[] in favor of ary.to_h or literal hashes.
|
|
1011
|
+
StyleGuide: "#avoid-hash-constructor"
|
|
1012
|
+
Enabled: true # was pending
|
|
1013
|
+
SafeAutoCorrect: false
|
|
1014
|
+
VersionAdded: '1.10'
|
|
1015
|
+
VersionChanged: '1.55'
|
|
1016
|
+
AllowSplatArgument: true
|
|
1017
|
+
|
|
1018
|
+
# Supports --autocorrect
|
|
1019
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehasheachmethods
|
|
1020
|
+
Style/HashEachMethods:
|
|
1021
|
+
Description: Use Hash#each_key and Hash#each_value.
|
|
1022
|
+
StyleGuide: "#hash-each"
|
|
1023
|
+
Enabled: true
|
|
1024
|
+
Safe: false
|
|
1025
|
+
VersionAdded: '0.80'
|
|
1026
|
+
VersionChanged: '1.16'
|
|
1027
|
+
AllowedReceivers:
|
|
1028
|
+
- Thread.current
|
|
1029
|
+
|
|
1030
|
+
# Supports --autocorrect
|
|
1031
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashexcept
|
|
1032
|
+
Style/HashExcept:
|
|
1033
|
+
Description: Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter`
|
|
1034
|
+
methods that can be replaced with `Hash#except` method.
|
|
1035
|
+
Enabled: true # was pending
|
|
1036
|
+
Safe: false
|
|
1037
|
+
VersionAdded: '1.7'
|
|
1038
|
+
VersionChanged: '1.39'
|
|
1039
|
+
|
|
1040
|
+
# Supports --autocorrect
|
|
1041
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashfetchchain
|
|
1042
|
+
Style/HashFetchChain:
|
|
1043
|
+
Description: Use `Hash#dig` instead of chained `fetch` calls.
|
|
1044
|
+
Enabled: true # was pending
|
|
1045
|
+
Safe: false
|
|
1046
|
+
VersionAdded: '1.75'
|
|
1047
|
+
|
|
1048
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashlikecase
|
|
1049
|
+
Style/HashLikeCase:
|
|
1050
|
+
Description: Checks for places where `case-when` represents a simple 1:1 mapping and
|
|
1051
|
+
can be replaced with a hash lookup.
|
|
1052
|
+
Enabled: true
|
|
1053
|
+
VersionAdded: '0.88'
|
|
1054
|
+
MinBranchesCount: 3
|
|
1055
|
+
|
|
1056
|
+
# Supports --autocorrect
|
|
1057
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashslice
|
|
1058
|
+
Style/HashSlice:
|
|
1059
|
+
Description: Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter`
|
|
1060
|
+
methods that can be replaced with `Hash#slice` method.
|
|
1061
|
+
Enabled: true # was pending
|
|
1062
|
+
Safe: false
|
|
1063
|
+
VersionAdded: '1.71'
|
|
1064
|
+
|
|
1065
|
+
# Supports --autocorrect
|
|
1066
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashsyntax
|
|
1067
|
+
Style/HashSyntax:
|
|
1068
|
+
Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1,
|
|
1069
|
+
:b => 2 }.'
|
|
1070
|
+
StyleGuide: "#hash-literals"
|
|
1071
|
+
Enabled: true
|
|
1072
|
+
VersionAdded: '0.9'
|
|
1073
|
+
VersionChanged: '1.67'
|
|
1074
|
+
EnforcedStyle: ruby19
|
|
1075
|
+
SupportedStyles:
|
|
1076
|
+
- ruby19
|
|
1077
|
+
- hash_rockets
|
|
1078
|
+
- no_mixed_keys
|
|
1079
|
+
- ruby19_no_mixed_keys
|
|
1080
|
+
EnforcedShorthandSyntax: either
|
|
1081
|
+
SupportedShorthandSyntax:
|
|
1082
|
+
- always
|
|
1083
|
+
- never
|
|
1084
|
+
- either
|
|
1085
|
+
- consistent
|
|
1086
|
+
- either_consistent
|
|
1087
|
+
UseHashRocketsWithSymbolValues: false
|
|
1088
|
+
PreferHashRocketsForNonAlnumEndingSymbols: false
|
|
1089
|
+
|
|
1090
|
+
# Supports --autocorrect
|
|
1091
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashtransformkeys
|
|
1092
|
+
Style/HashTransformKeys:
|
|
1093
|
+
Description: Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.
|
|
1094
|
+
Enabled: true
|
|
1095
|
+
VersionAdded: '0.80'
|
|
1096
|
+
VersionChanged: '0.90'
|
|
1097
|
+
Safe: false
|
|
1098
|
+
|
|
1099
|
+
# Supports --autocorrect
|
|
1100
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashtransformvalues
|
|
1101
|
+
Style/HashTransformValues:
|
|
1102
|
+
Description: Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.
|
|
1103
|
+
Enabled: true
|
|
1104
|
+
VersionAdded: '0.80'
|
|
1105
|
+
VersionChanged: '0.90'
|
|
1106
|
+
Safe: false
|
|
1107
|
+
|
|
1108
|
+
# Supports --autocorrect
|
|
1109
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleidenticalconditionalbranches
|
|
1110
|
+
Style/IdenticalConditionalBranches:
|
|
1111
|
+
Description: Checks that conditional statements do not have an identical line at the
|
|
1112
|
+
end of each branch, which can validly be moved out of the conditional.
|
|
1113
|
+
Enabled: true
|
|
1114
|
+
SafeAutoCorrect: false
|
|
1115
|
+
VersionAdded: '0.36'
|
|
1116
|
+
VersionChanged: '1.19'
|
|
1117
|
+
|
|
1118
|
+
# Supports --autocorrect
|
|
1119
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleifinsideelse
|
|
1120
|
+
Style/IfInsideElse:
|
|
1121
|
+
Description: Finds if nodes inside else, which can be converted to elsif.
|
|
1122
|
+
Enabled: true
|
|
1123
|
+
AllowIfModifier: false
|
|
1124
|
+
VersionAdded: '0.36'
|
|
1125
|
+
VersionChanged: '1.3'
|
|
1126
|
+
|
|
1127
|
+
# Supports --autocorrect
|
|
1128
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleifunlessmodifier
|
|
1129
|
+
Style/IfUnlessModifier:
|
|
1130
|
+
Description: Favor modifier if/unless usage when you have a single-line body.
|
|
1131
|
+
StyleGuide: "#if-as-a-modifier"
|
|
1132
|
+
Enabled: true
|
|
1133
|
+
VersionAdded: '0.9'
|
|
1134
|
+
VersionChanged: '0.30'
|
|
1135
|
+
|
|
1136
|
+
# Supports --autocorrect
|
|
1137
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleifunlessmodifierofifunless
|
|
1138
|
+
Style/IfUnlessModifierOfIfUnless:
|
|
1139
|
+
Description: Avoid modifier if/unless usage on conditionals.
|
|
1140
|
+
Enabled: true
|
|
1141
|
+
VersionAdded: '0.39'
|
|
1142
|
+
VersionChanged: '0.87'
|
|
1143
|
+
|
|
1144
|
+
# Supports --autocorrect
|
|
1145
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleifwithbooleanliteralbranches
|
|
1146
|
+
Style/IfWithBooleanLiteralBranches:
|
|
1147
|
+
Description: Checks for redundant `if` with boolean literal branches.
|
|
1148
|
+
Enabled: true # was pending
|
|
1149
|
+
VersionAdded: '1.9'
|
|
1150
|
+
SafeAutoCorrect: false
|
|
1151
|
+
AllowedMethods:
|
|
1152
|
+
- nonzero?
|
|
1153
|
+
|
|
1154
|
+
# Supports --autocorrect
|
|
1155
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleifwithsemicolon
|
|
1156
|
+
Style/IfWithSemicolon:
|
|
1157
|
+
Description: Do not use if x; .... Use the ternary operator instead.
|
|
1158
|
+
StyleGuide: "#no-semicolon-ifs"
|
|
1159
|
+
Enabled: true
|
|
1160
|
+
VersionAdded: '0.9'
|
|
1161
|
+
VersionChanged: '0.83'
|
|
1162
|
+
|
|
1163
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleimplicitruntimeerror
|
|
1164
|
+
Style/ImplicitRuntimeError:
|
|
1165
|
+
Description: Use `raise` or `fail` with an explicit exception class and message, rather
|
|
1166
|
+
than just a message.
|
|
1167
|
+
Enabled: true # was false
|
|
1168
|
+
VersionAdded: '0.41'
|
|
1169
|
+
|
|
1170
|
+
# Supports --autocorrect
|
|
1171
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleinpatternthen
|
|
1172
|
+
Style/InPatternThen:
|
|
1173
|
+
Description: Checks for `in;` uses in `case` expressions.
|
|
1174
|
+
StyleGuide: "#no-in-pattern-semicolons"
|
|
1175
|
+
Enabled: true # was pending
|
|
1176
|
+
VersionAdded: '1.16'
|
|
1177
|
+
|
|
1178
|
+
# Supports --autocorrect
|
|
1179
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleinfiniteloop
|
|
1180
|
+
Style/InfiniteLoop:
|
|
1181
|
+
Description: Use Kernel#loop for infinite loops. This cop is unsafe if the body may
|
|
1182
|
+
raise a `StopIteration` exception.
|
|
1183
|
+
Safe: false
|
|
1184
|
+
StyleGuide: "#infinite-loop"
|
|
1185
|
+
Enabled: true
|
|
1186
|
+
VersionAdded: '0.26'
|
|
1187
|
+
VersionChanged: '0.61'
|
|
1188
|
+
|
|
1189
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleinlinecomment
|
|
1190
|
+
Style/InlineComment:
|
|
1191
|
+
Description: Avoid trailing inline comments.
|
|
1192
|
+
Enabled: true # was false
|
|
1193
|
+
VersionAdded: '0.23'
|
|
1194
|
+
|
|
1195
|
+
# Supports --autocorrect
|
|
1196
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleinversemethods
|
|
1197
|
+
Style/InverseMethods:
|
|
1198
|
+
Description: Use the inverse method instead of `!.method` if an inverse method is
|
|
1199
|
+
defined.
|
|
1200
|
+
Enabled: true
|
|
1201
|
+
Safe: false
|
|
1202
|
+
VersionAdded: '0.48'
|
|
1203
|
+
InverseMethods:
|
|
1204
|
+
:any?: :none?
|
|
1205
|
+
:even?: :odd?
|
|
1206
|
+
:==: :!=
|
|
1207
|
+
:=~: :!~
|
|
1208
|
+
:<: :>=
|
|
1209
|
+
:>: :<=
|
|
1210
|
+
InverseBlocks:
|
|
1211
|
+
:select: :reject
|
|
1212
|
+
:select!: :reject!
|
|
1213
|
+
|
|
1214
|
+
# Supports --autocorrect
|
|
1215
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleinvertibleunlesscondition
|
|
1216
|
+
Style/InvertibleUnlessCondition:
|
|
1217
|
+
Description: Favor `if` with inverted condition over `unless`.
|
|
1218
|
+
Enabled: true # was false
|
|
1219
|
+
Safe: false
|
|
1220
|
+
VersionAdded: '1.44'
|
|
1221
|
+
VersionChanged: '1.50'
|
|
1222
|
+
InverseMethods:
|
|
1223
|
+
:!=: :==
|
|
1224
|
+
:>: :<=
|
|
1225
|
+
:<=: :>
|
|
1226
|
+
:<: :>=
|
|
1227
|
+
:>=: :<
|
|
1228
|
+
:!~: :=~
|
|
1229
|
+
:zero?: :nonzero?
|
|
1230
|
+
:nonzero?: :zero?
|
|
1231
|
+
:any?: :none?
|
|
1232
|
+
:none?: :any?
|
|
1233
|
+
:even?: :odd?
|
|
1234
|
+
:odd?: :even?
|
|
1235
|
+
|
|
1236
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleipaddresses
|
|
1237
|
+
Style/IpAddresses:
|
|
1238
|
+
Description: Don't include literal IP addresses in code.
|
|
1239
|
+
Enabled: true # was false
|
|
1240
|
+
VersionAdded: '0.58'
|
|
1241
|
+
VersionChanged: '0.91'
|
|
1242
|
+
AllowedAddresses:
|
|
1243
|
+
- "::"
|
|
1244
|
+
Exclude:
|
|
1245
|
+
- "**/*.gemfile"
|
|
1246
|
+
- "**/Gemfile"
|
|
1247
|
+
- "**/gems.rb"
|
|
1248
|
+
- "**/*.gemspec"
|
|
1249
|
+
|
|
1250
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleitassignment
|
|
1251
|
+
Style/ItAssignment:
|
|
1252
|
+
Description: Checks for local variables and method parameters named `it`.
|
|
1253
|
+
Enabled: true # was pending
|
|
1254
|
+
VersionAdded: '1.70'
|
|
1255
|
+
|
|
1256
|
+
# Supports --autocorrect
|
|
1257
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleitblockparameter
|
|
1258
|
+
Style/ItBlockParameter:
|
|
1259
|
+
Description: Checks for blocks with one argument where `it` block parameter can be
|
|
1260
|
+
used.
|
|
1261
|
+
Enabled: true # was pending
|
|
1262
|
+
EnforcedStyle: allow_single_line
|
|
1263
|
+
SupportedStyles:
|
|
1264
|
+
- allow_single_line
|
|
1265
|
+
- only_numbered_parameters
|
|
1266
|
+
- always
|
|
1267
|
+
- disallow
|
|
1268
|
+
VersionAdded: '1.75'
|
|
1269
|
+
VersionChanged: '1.76'
|
|
1270
|
+
|
|
1271
|
+
# Supports --autocorrect
|
|
1272
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylekeywordargumentsmerging
|
|
1273
|
+
Style/KeywordArgumentsMerging:
|
|
1274
|
+
Description: When passing an existing hash as keyword arguments, provide additional
|
|
1275
|
+
arguments directly rather than using `merge`.
|
|
1276
|
+
StyleGuide: "#merging-keyword-arguments"
|
|
1277
|
+
Enabled: true # was pending
|
|
1278
|
+
VersionAdded: '1.68'
|
|
1279
|
+
|
|
1280
|
+
# Supports --autocorrect
|
|
1281
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylekeywordparametersorder
|
|
1282
|
+
Style/KeywordParametersOrder:
|
|
1283
|
+
Description: Enforces that optional keyword parameters are placed at the end of the
|
|
1284
|
+
parameters list.
|
|
1285
|
+
StyleGuide: "#keyword-parameters-order"
|
|
1286
|
+
Enabled: true
|
|
1287
|
+
VersionAdded: '0.90'
|
|
1288
|
+
VersionChanged: '1.7'
|
|
1289
|
+
|
|
1290
|
+
# Supports --autocorrect
|
|
1291
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylelambda
|
|
1292
|
+
Style/Lambda:
|
|
1293
|
+
Description: Use the new lambda literal syntax for single-line blocks.
|
|
1294
|
+
StyleGuide: "#lambda-multi-line"
|
|
1295
|
+
Enabled: true
|
|
1296
|
+
VersionAdded: '0.9'
|
|
1297
|
+
VersionChanged: '0.40'
|
|
1298
|
+
EnforcedStyle: line_count_dependent
|
|
1299
|
+
SupportedStyles:
|
|
1300
|
+
- line_count_dependent
|
|
1301
|
+
- lambda
|
|
1302
|
+
- literal
|
|
1303
|
+
|
|
1304
|
+
# Supports --autocorrect
|
|
1305
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylelambdacall
|
|
1306
|
+
Style/LambdaCall:
|
|
1307
|
+
Description: Use lambda.call(...) instead of lambda.(...).
|
|
1308
|
+
StyleGuide: "#proc-call"
|
|
1309
|
+
Enabled: true
|
|
1310
|
+
AutoCorrect: contextual
|
|
1311
|
+
VersionAdded: '0.13'
|
|
1312
|
+
VersionChanged: '1.81'
|
|
1313
|
+
EnforcedStyle: call
|
|
1314
|
+
SupportedStyles:
|
|
1315
|
+
- call
|
|
1316
|
+
- braces
|
|
1317
|
+
|
|
1318
|
+
# Supports --autocorrect
|
|
1319
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylelineendconcatenation
|
|
1320
|
+
Style/LineEndConcatenation:
|
|
1321
|
+
Description: Use \ instead of + or << to concatenate two string literals at line end.
|
|
1322
|
+
Enabled: true
|
|
1323
|
+
SafeAutoCorrect: false
|
|
1324
|
+
VersionAdded: '0.18'
|
|
1325
|
+
VersionChanged: '0.64'
|
|
1326
|
+
|
|
1327
|
+
# Supports --autocorrect
|
|
1328
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemagiccommentformat
|
|
1329
|
+
Style/MagicCommentFormat:
|
|
1330
|
+
Description: Use a consistent style for magic comments.
|
|
1331
|
+
Enabled: true # was pending
|
|
1332
|
+
VersionAdded: '1.35'
|
|
1333
|
+
EnforcedStyle: snake_case
|
|
1334
|
+
SupportedStyles:
|
|
1335
|
+
- snake_case
|
|
1336
|
+
- kebab_case
|
|
1337
|
+
DirectiveCapitalization: lowercase
|
|
1338
|
+
ValueCapitalization:
|
|
1339
|
+
SupportedCapitalizations:
|
|
1340
|
+
- lowercase
|
|
1341
|
+
- uppercase
|
|
1342
|
+
|
|
1343
|
+
# Supports --autocorrect
|
|
1344
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemapcompactwithconditionalblock
|
|
1345
|
+
Style/MapCompactWithConditionalBlock:
|
|
1346
|
+
Description: Prefer `select` or `reject` over `map { ... }.compact`.
|
|
1347
|
+
Enabled: true # was pending
|
|
1348
|
+
VersionAdded: '1.30'
|
|
1349
|
+
|
|
1350
|
+
# Supports --autocorrect
|
|
1351
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemapintoarray
|
|
1352
|
+
Style/MapIntoArray:
|
|
1353
|
+
Description: Checks for usages of `each` with `<<`, `push`, or `append` which can
|
|
1354
|
+
be replaced by `map`.
|
|
1355
|
+
StyleGuide: "#functional-code"
|
|
1356
|
+
Enabled: true # was pending
|
|
1357
|
+
VersionAdded: '1.63'
|
|
1358
|
+
VersionChanged: '1.67'
|
|
1359
|
+
Safe: false
|
|
1360
|
+
|
|
1361
|
+
# Supports --autocorrect
|
|
1362
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemaptohash
|
|
1363
|
+
Style/MapToHash:
|
|
1364
|
+
Description: Prefer `to_h` with a block over `map.to_h`.
|
|
1365
|
+
Enabled: true # was pending
|
|
1366
|
+
VersionAdded: '1.24'
|
|
1367
|
+
Safe: false
|
|
1368
|
+
|
|
1369
|
+
# Supports --autocorrect
|
|
1370
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemaptoset
|
|
1371
|
+
Style/MapToSet:
|
|
1372
|
+
Description: Prefer `to_set` with a block over `map.to_set`.
|
|
1373
|
+
Enabled: true # was pending
|
|
1374
|
+
Safe: false
|
|
1375
|
+
VersionAdded: '1.42'
|
|
1376
|
+
|
|
1377
|
+
# Supports --autocorrect
|
|
1378
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemethodcallwithargsparentheses
|
|
1379
|
+
Style/MethodCallWithArgsParentheses:
|
|
1380
|
+
Description: Use parentheses for method calls with arguments.
|
|
1381
|
+
StyleGuide: "#method-invocation-parens"
|
|
1382
|
+
Enabled: true # was false
|
|
1383
|
+
VersionAdded: '0.47'
|
|
1384
|
+
VersionChanged: '1.7'
|
|
1385
|
+
IgnoreMacros: true
|
|
1386
|
+
AllowedMethods: []
|
|
1387
|
+
AllowedPatterns: []
|
|
1388
|
+
IncludedMacros: []
|
|
1389
|
+
AllowParenthesesInMultilineCall: false
|
|
1390
|
+
AllowParenthesesInChaining: false
|
|
1391
|
+
AllowParenthesesInCamelCaseMethod: false
|
|
1392
|
+
AllowParenthesesInStringInterpolation: false
|
|
1393
|
+
EnforcedStyle: require_parentheses
|
|
1394
|
+
SupportedStyles:
|
|
1395
|
+
- require_parentheses
|
|
1396
|
+
- omit_parentheses
|
|
1397
|
+
|
|
1398
|
+
# Supports --autocorrect
|
|
1399
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemethodcallwithoutargsparentheses
|
|
1400
|
+
Style/MethodCallWithoutArgsParentheses:
|
|
1401
|
+
Description: Do not use parentheses for method calls with no arguments.
|
|
1402
|
+
StyleGuide: "#method-invocation-parens"
|
|
1403
|
+
Enabled: true
|
|
1404
|
+
AllowedMethods: []
|
|
1405
|
+
AllowedPatterns: []
|
|
1406
|
+
VersionAdded: '0.47'
|
|
1407
|
+
VersionChanged: '0.55'
|
|
1408
|
+
|
|
1409
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemethodcalledondoendblock
|
|
1410
|
+
Style/MethodCalledOnDoEndBlock:
|
|
1411
|
+
Description: Avoid chaining a method call on a do...end block.
|
|
1412
|
+
StyleGuide: "#single-line-blocks"
|
|
1413
|
+
Enabled: true # was false
|
|
1414
|
+
VersionAdded: '0.14'
|
|
1415
|
+
|
|
1416
|
+
# Supports --autocorrect
|
|
1417
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemethoddefparentheses
|
|
1418
|
+
Style/MethodDefParentheses:
|
|
1419
|
+
Description: Checks if the method definitions have or don't have parentheses.
|
|
1420
|
+
StyleGuide: "#method-parens"
|
|
1421
|
+
Enabled: true
|
|
1422
|
+
VersionAdded: '0.16'
|
|
1423
|
+
VersionChanged: '1.7'
|
|
1424
|
+
EnforcedStyle: require_parentheses
|
|
1425
|
+
SupportedStyles:
|
|
1426
|
+
- require_parentheses
|
|
1427
|
+
- require_no_parentheses
|
|
1428
|
+
- require_no_parentheses_except_multiline
|
|
1429
|
+
|
|
1430
|
+
# Supports --autocorrect
|
|
1431
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleminmax
|
|
1432
|
+
Style/MinMax:
|
|
1433
|
+
Description: Use `Enumerable#minmax` instead of `Enumerable#min` and `Enumerable#max`
|
|
1434
|
+
in conjunction.
|
|
1435
|
+
Enabled: true
|
|
1436
|
+
VersionAdded: '0.50'
|
|
1437
|
+
|
|
1438
|
+
# Supports --autocorrect
|
|
1439
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleminmaxcomparison
|
|
1440
|
+
Style/MinMaxComparison:
|
|
1441
|
+
Description: Enforces the use of `max` or `min` instead of comparison for greater
|
|
1442
|
+
or less.
|
|
1443
|
+
Enabled: true # was pending
|
|
1444
|
+
Safe: false
|
|
1445
|
+
VersionAdded: '1.42'
|
|
1446
|
+
|
|
1447
|
+
# Supports --autocorrect
|
|
1448
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemissingelse
|
|
1449
|
+
Style/MissingElse:
|
|
1450
|
+
Description: Require if/case expressions to have an else branches. If enabled, it
|
|
1451
|
+
is recommended that Style/UnlessElse and Style/EmptyElse be enabled. This will conflict
|
|
1452
|
+
with Style/EmptyElse if Style/EmptyElse is configured to style "both".
|
|
1453
|
+
Enabled: true # was false
|
|
1454
|
+
VersionAdded: '0.30'
|
|
1455
|
+
VersionChanged: '0.38'
|
|
1456
|
+
EnforcedStyle: both
|
|
1457
|
+
SupportedStyles:
|
|
1458
|
+
- if
|
|
1459
|
+
- case
|
|
1460
|
+
- both
|
|
1461
|
+
|
|
1462
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemissingrespondtomissing
|
|
1463
|
+
Style/MissingRespondToMissing:
|
|
1464
|
+
Description: Checks if `method_missing` is implemented without implementing `respond_to_missing`.
|
|
1465
|
+
StyleGuide: "#no-method-missing"
|
|
1466
|
+
Enabled: true
|
|
1467
|
+
VersionAdded: '0.56'
|
|
1468
|
+
|
|
1469
|
+
# Supports --autocorrect
|
|
1470
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemixingrouping
|
|
1471
|
+
Style/MixinGrouping:
|
|
1472
|
+
Description: Checks for grouping of mixins in `class` and `module` bodies.
|
|
1473
|
+
StyleGuide: "#mixin-grouping"
|
|
1474
|
+
Enabled: true
|
|
1475
|
+
VersionAdded: '0.48'
|
|
1476
|
+
VersionChanged: '0.49'
|
|
1477
|
+
EnforcedStyle: separated
|
|
1478
|
+
SupportedStyles:
|
|
1479
|
+
- separated
|
|
1480
|
+
- grouped
|
|
1481
|
+
|
|
1482
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemixinusage
|
|
1483
|
+
Style/MixinUsage:
|
|
1484
|
+
Description: Checks that `include`, `extend` and `prepend` exists at the top level.
|
|
1485
|
+
Enabled: true
|
|
1486
|
+
VersionAdded: '0.51'
|
|
1487
|
+
|
|
1488
|
+
# Supports --autocorrect
|
|
1489
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemodulefunction
|
|
1490
|
+
Style/ModuleFunction:
|
|
1491
|
+
Description: Checks for usage of `extend self` in modules.
|
|
1492
|
+
StyleGuide: "#module-function"
|
|
1493
|
+
Enabled: true
|
|
1494
|
+
VersionAdded: '0.11'
|
|
1495
|
+
VersionChanged: '0.65'
|
|
1496
|
+
EnforcedStyle: module_function
|
|
1497
|
+
SupportedStyles:
|
|
1498
|
+
- module_function
|
|
1499
|
+
- extend_self
|
|
1500
|
+
- forbidden
|
|
1501
|
+
Autocorrect: false
|
|
1502
|
+
SafeAutoCorrect: false
|
|
1503
|
+
|
|
1504
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilineblockchain
|
|
1505
|
+
Style/MultilineBlockChain:
|
|
1506
|
+
Description: Avoid multi-line chains of blocks.
|
|
1507
|
+
StyleGuide: "#single-line-blocks"
|
|
1508
|
+
Enabled: true
|
|
1509
|
+
VersionAdded: '0.13'
|
|
1510
|
+
|
|
1511
|
+
# Supports --autocorrect
|
|
1512
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilineifmodifier
|
|
1513
|
+
Style/MultilineIfModifier:
|
|
1514
|
+
Description: Only use if/unless modifiers on single line statements.
|
|
1515
|
+
StyleGuide: "#no-multiline-if-modifiers"
|
|
1516
|
+
Enabled: true
|
|
1517
|
+
VersionAdded: '0.45'
|
|
1518
|
+
|
|
1519
|
+
# Supports --autocorrect
|
|
1520
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilineifthen
|
|
1521
|
+
Style/MultilineIfThen:
|
|
1522
|
+
Description: Do not use then for multi-line if/unless.
|
|
1523
|
+
StyleGuide: "#no-then"
|
|
1524
|
+
Enabled: true
|
|
1525
|
+
VersionAdded: '0.9'
|
|
1526
|
+
VersionChanged: '0.26'
|
|
1527
|
+
|
|
1528
|
+
# Supports --autocorrect
|
|
1529
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilineinpatternthen
|
|
1530
|
+
Style/MultilineInPatternThen:
|
|
1531
|
+
Description: Do not use `then` for multi-line `in` statement.
|
|
1532
|
+
StyleGuide: "#no-then"
|
|
1533
|
+
Enabled: true # was pending
|
|
1534
|
+
VersionAdded: '1.16'
|
|
1535
|
+
|
|
1536
|
+
# Supports --autocorrect
|
|
1537
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilinememoization
|
|
1538
|
+
Style/MultilineMemoization:
|
|
1539
|
+
Description: Wrap multiline memoizations in a `begin` and `end` block.
|
|
1540
|
+
Enabled: true
|
|
1541
|
+
VersionAdded: '0.44'
|
|
1542
|
+
VersionChanged: '0.48'
|
|
1543
|
+
EnforcedStyle: keyword
|
|
1544
|
+
SupportedStyles:
|
|
1545
|
+
- keyword
|
|
1546
|
+
- braces
|
|
1547
|
+
|
|
1548
|
+
# Supports --autocorrect
|
|
1549
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilinemethodsignature
|
|
1550
|
+
Style/MultilineMethodSignature:
|
|
1551
|
+
Description: Avoid multi-line method signatures.
|
|
1552
|
+
Enabled: true # was false
|
|
1553
|
+
VersionAdded: '0.59'
|
|
1554
|
+
VersionChanged: '1.7'
|
|
1555
|
+
|
|
1556
|
+
# Supports --autocorrect
|
|
1557
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilineternaryoperator
|
|
1558
|
+
Style/MultilineTernaryOperator:
|
|
1559
|
+
Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
|
|
1560
|
+
StyleGuide: "#no-multiline-ternary"
|
|
1561
|
+
Enabled: true
|
|
1562
|
+
VersionAdded: '0.9'
|
|
1563
|
+
VersionChanged: '0.86'
|
|
1564
|
+
|
|
1565
|
+
# Supports --autocorrect
|
|
1566
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilinewhenthen
|
|
1567
|
+
Style/MultilineWhenThen:
|
|
1568
|
+
Description: Do not use then for multi-line when statement.
|
|
1569
|
+
StyleGuide: "#no-then"
|
|
1570
|
+
Enabled: true
|
|
1571
|
+
VersionAdded: '0.73'
|
|
1572
|
+
|
|
1573
|
+
# Supports --autocorrect
|
|
1574
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultiplecomparison
|
|
1575
|
+
Style/MultipleComparison:
|
|
1576
|
+
Description: Avoid comparing a variable with multiple items in a conditional, use
|
|
1577
|
+
Array#include? instead.
|
|
1578
|
+
Enabled: true
|
|
1579
|
+
VersionAdded: '0.49'
|
|
1580
|
+
VersionChanged: '1.1'
|
|
1581
|
+
AllowMethodComparison: true
|
|
1582
|
+
ComparisonsThreshold: 2
|
|
1583
|
+
|
|
1584
|
+
# Supports --autocorrect
|
|
1585
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemutableconstant
|
|
1586
|
+
Style/MutableConstant:
|
|
1587
|
+
Description: Do not assign mutable objects to constants.
|
|
1588
|
+
Enabled: true
|
|
1589
|
+
VersionAdded: '0.34'
|
|
1590
|
+
VersionChanged: '1.8'
|
|
1591
|
+
SafeAutoCorrect: false
|
|
1592
|
+
EnforcedStyle: literals
|
|
1593
|
+
SupportedStyles:
|
|
1594
|
+
- literals
|
|
1595
|
+
- strict
|
|
1596
|
+
|
|
1597
|
+
# Supports --autocorrect
|
|
1598
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenegatedif
|
|
1599
|
+
Style/NegatedIf:
|
|
1600
|
+
Description: Favor unless over if for negative conditions (or control flow or).
|
|
1601
|
+
StyleGuide: "#unless-for-negatives"
|
|
1602
|
+
Enabled: true
|
|
1603
|
+
VersionAdded: '0.20'
|
|
1604
|
+
VersionChanged: '0.48'
|
|
1605
|
+
EnforcedStyle: both
|
|
1606
|
+
SupportedStyles:
|
|
1607
|
+
- both
|
|
1608
|
+
- prefix
|
|
1609
|
+
- postfix
|
|
1610
|
+
|
|
1611
|
+
# Supports --autocorrect
|
|
1612
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenegatedifelsecondition
|
|
1613
|
+
Style/NegatedIfElseCondition:
|
|
1614
|
+
Description: Checks for uses of `if-else` and ternary operators with a negated condition
|
|
1615
|
+
which can be simplified by inverting condition and swapping branches.
|
|
1616
|
+
Enabled: true # was pending
|
|
1617
|
+
VersionAdded: '1.2'
|
|
1618
|
+
|
|
1619
|
+
# Supports --autocorrect
|
|
1620
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenegatedunless
|
|
1621
|
+
Style/NegatedUnless:
|
|
1622
|
+
Description: Favor if over unless for negative conditions.
|
|
1623
|
+
StyleGuide: "#if-for-negatives"
|
|
1624
|
+
Enabled: true
|
|
1625
|
+
VersionAdded: '0.69'
|
|
1626
|
+
EnforcedStyle: both
|
|
1627
|
+
SupportedStyles:
|
|
1628
|
+
- both
|
|
1629
|
+
- prefix
|
|
1630
|
+
- postfix
|
|
1631
|
+
|
|
1632
|
+
# Supports --autocorrect
|
|
1633
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenegatedwhile
|
|
1634
|
+
Style/NegatedWhile:
|
|
1635
|
+
Description: Favor until over while for negative conditions.
|
|
1636
|
+
StyleGuide: "#until-for-negatives"
|
|
1637
|
+
Enabled: true
|
|
1638
|
+
VersionAdded: '0.20'
|
|
1639
|
+
|
|
1640
|
+
# Supports --autocorrect
|
|
1641
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenestedfiledirname
|
|
1642
|
+
Style/NestedFileDirname:
|
|
1643
|
+
Description: Checks for nested `File.dirname`.
|
|
1644
|
+
Enabled: true # was pending
|
|
1645
|
+
VersionAdded: '1.26'
|
|
1646
|
+
|
|
1647
|
+
# Supports --autocorrect
|
|
1648
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenestedmodifier
|
|
1649
|
+
Style/NestedModifier:
|
|
1650
|
+
Description: Avoid using nested modifiers.
|
|
1651
|
+
StyleGuide: "#no-nested-modifiers"
|
|
1652
|
+
Enabled: true
|
|
1653
|
+
VersionAdded: '0.35'
|
|
1654
|
+
|
|
1655
|
+
# Supports --autocorrect
|
|
1656
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenestedparenthesizedcalls
|
|
1657
|
+
Style/NestedParenthesizedCalls:
|
|
1658
|
+
Description: Parenthesize method calls which are nested inside the argument list of
|
|
1659
|
+
another parenthesized method call.
|
|
1660
|
+
Enabled: true
|
|
1661
|
+
VersionAdded: '0.36'
|
|
1662
|
+
VersionChanged: '0.77'
|
|
1663
|
+
AllowedMethods:
|
|
1664
|
+
- be
|
|
1665
|
+
- be_a
|
|
1666
|
+
- be_an
|
|
1667
|
+
- be_between
|
|
1668
|
+
- be_falsey
|
|
1669
|
+
- be_kind_of
|
|
1670
|
+
- be_instance_of
|
|
1671
|
+
- be_truthy
|
|
1672
|
+
- be_within
|
|
1673
|
+
- eq
|
|
1674
|
+
- eql
|
|
1675
|
+
- end_with
|
|
1676
|
+
- include
|
|
1677
|
+
- match
|
|
1678
|
+
- raise_error
|
|
1679
|
+
- respond_to
|
|
1680
|
+
- start_with
|
|
1681
|
+
|
|
1682
|
+
# Supports --autocorrect
|
|
1683
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenestedternaryoperator
|
|
1684
|
+
Style/NestedTernaryOperator:
|
|
1685
|
+
Description: Use one expression per branch in a ternary operator.
|
|
1686
|
+
StyleGuide: "#no-nested-ternary"
|
|
1687
|
+
Enabled: true
|
|
1688
|
+
VersionAdded: '0.9'
|
|
1689
|
+
VersionChanged: '0.86'
|
|
1690
|
+
|
|
1691
|
+
# Supports --autocorrect
|
|
1692
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenext
|
|
1693
|
+
Style/Next:
|
|
1694
|
+
Description: Use `next` to skip iteration instead of a condition at the end.
|
|
1695
|
+
StyleGuide: "#no-nested-conditionals"
|
|
1696
|
+
Enabled: true
|
|
1697
|
+
VersionAdded: '0.22'
|
|
1698
|
+
VersionChanged: '1.75'
|
|
1699
|
+
EnforcedStyle: skip_modifier_ifs
|
|
1700
|
+
MinBodyLength: 3
|
|
1701
|
+
AllowConsecutiveConditionals: false
|
|
1702
|
+
SupportedStyles:
|
|
1703
|
+
- skip_modifier_ifs
|
|
1704
|
+
- always
|
|
1705
|
+
|
|
1706
|
+
# Supports --autocorrect
|
|
1707
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenilcomparison
|
|
1708
|
+
Style/NilComparison:
|
|
1709
|
+
Description: Prefer x.nil? to x == nil.
|
|
1710
|
+
StyleGuide: "#predicate-methods"
|
|
1711
|
+
Enabled: true
|
|
1712
|
+
VersionAdded: '0.12'
|
|
1713
|
+
VersionChanged: '0.59'
|
|
1714
|
+
EnforcedStyle: predicate
|
|
1715
|
+
SupportedStyles:
|
|
1716
|
+
- predicate
|
|
1717
|
+
- comparison
|
|
1718
|
+
|
|
1719
|
+
# Supports --autocorrect
|
|
1720
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenillambda
|
|
1721
|
+
Style/NilLambda:
|
|
1722
|
+
Description: Prefer `-> {}` to `-> { nil }`.
|
|
1723
|
+
Enabled: true # was pending
|
|
1724
|
+
VersionAdded: '1.3'
|
|
1725
|
+
VersionChanged: '1.15'
|
|
1726
|
+
|
|
1727
|
+
# Supports --autocorrect
|
|
1728
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenonnilcheck
|
|
1729
|
+
Style/NonNilCheck:
|
|
1730
|
+
Description: Checks for redundant nil checks.
|
|
1731
|
+
StyleGuide: "#no-non-nil-checks"
|
|
1732
|
+
Enabled: true
|
|
1733
|
+
VersionAdded: '0.20'
|
|
1734
|
+
VersionChanged: '0.22'
|
|
1735
|
+
IncludeSemanticChanges: false
|
|
1736
|
+
|
|
1737
|
+
# Supports --autocorrect
|
|
1738
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenot
|
|
1739
|
+
Style/Not:
|
|
1740
|
+
Description: Use ! instead of not.
|
|
1741
|
+
StyleGuide: "#bang-not-not"
|
|
1742
|
+
Enabled: true
|
|
1743
|
+
VersionAdded: '0.9'
|
|
1744
|
+
VersionChanged: '0.20'
|
|
1745
|
+
|
|
1746
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumberedparameters
|
|
1747
|
+
Style/NumberedParameters:
|
|
1748
|
+
Description: Restrict the usage of numbered parameters.
|
|
1749
|
+
Enabled: true # was pending
|
|
1750
|
+
VersionAdded: '1.22'
|
|
1751
|
+
EnforcedStyle: allow_single_line
|
|
1752
|
+
SupportedStyles:
|
|
1753
|
+
- allow_single_line
|
|
1754
|
+
- disallow
|
|
1755
|
+
|
|
1756
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumberedparameterslimit
|
|
1757
|
+
Style/NumberedParametersLimit:
|
|
1758
|
+
Description: Avoid excessive numbered params in a single block.
|
|
1759
|
+
Enabled: true # was pending
|
|
1760
|
+
VersionAdded: '1.22'
|
|
1761
|
+
Max: 1
|
|
1762
|
+
|
|
1763
|
+
# Supports --autocorrect
|
|
1764
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumericliteralprefix
|
|
1765
|
+
Style/NumericLiteralPrefix:
|
|
1766
|
+
Description: Use smallcase prefixes for numeric literals.
|
|
1767
|
+
StyleGuide: "#numeric-literal-prefixes"
|
|
1768
|
+
Enabled: true
|
|
1769
|
+
VersionAdded: '0.41'
|
|
1770
|
+
EnforcedOctalStyle: zero_with_o
|
|
1771
|
+
SupportedOctalStyles:
|
|
1772
|
+
- zero_with_o
|
|
1773
|
+
- zero_only
|
|
1774
|
+
|
|
1775
|
+
# Supports --autocorrect
|
|
1776
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumericliterals
|
|
1777
|
+
Style/NumericLiterals:
|
|
1778
|
+
Description: Add underscores to large numeric literals to improve their readability.
|
|
1779
|
+
StyleGuide: "#underscores-in-numerics"
|
|
1780
|
+
Enabled: true
|
|
1781
|
+
VersionAdded: '0.9'
|
|
1782
|
+
VersionChanged: '0.48'
|
|
1783
|
+
MinDigits: 5
|
|
1784
|
+
Strict: false
|
|
1785
|
+
AllowedNumbers: []
|
|
1786
|
+
AllowedPatterns: []
|
|
1787
|
+
|
|
1788
|
+
# Supports --autocorrect
|
|
1789
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumericpredicate
|
|
1790
|
+
Style/NumericPredicate:
|
|
1791
|
+
Description: Checks for the use of predicate- or comparison methods for numeric comparisons.
|
|
1792
|
+
StyleGuide: "#predicate-methods"
|
|
1793
|
+
Safe: false
|
|
1794
|
+
Enabled: true
|
|
1795
|
+
VersionAdded: '0.42'
|
|
1796
|
+
VersionChanged: '0.59'
|
|
1797
|
+
EnforcedStyle: predicate
|
|
1798
|
+
SupportedStyles:
|
|
1799
|
+
- predicate
|
|
1800
|
+
- comparison
|
|
1801
|
+
AllowedMethods: []
|
|
1802
|
+
AllowedPatterns: []
|
|
1803
|
+
Exclude:
|
|
1804
|
+
- "spec/**/*"
|
|
1805
|
+
|
|
1806
|
+
# Supports --autocorrect
|
|
1807
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleobjectthen
|
|
1808
|
+
Style/ObjectThen:
|
|
1809
|
+
Description: Enforces the use of consistent method names `Object#yield_self` or `Object#then`.
|
|
1810
|
+
StyleGuide: "#object-yield-self-vs-object-then"
|
|
1811
|
+
Enabled: true # was pending
|
|
1812
|
+
VersionAdded: '1.28'
|
|
1813
|
+
EnforcedStyle: then
|
|
1814
|
+
SupportedStyles:
|
|
1815
|
+
- then
|
|
1816
|
+
- yield_self
|
|
1817
|
+
|
|
1818
|
+
# Supports --autocorrect
|
|
1819
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleonelineconditional
|
|
1820
|
+
Style/OneLineConditional:
|
|
1821
|
+
Description: Favor the ternary operator (?:) or multi-line constructs over single-line
|
|
1822
|
+
if/then/else/end constructs.
|
|
1823
|
+
StyleGuide: "#ternary-operator"
|
|
1824
|
+
Enabled: true
|
|
1825
|
+
AlwaysCorrectToMultiline: false
|
|
1826
|
+
VersionAdded: '0.9'
|
|
1827
|
+
VersionChanged: '0.90'
|
|
1828
|
+
|
|
1829
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleopenstructuse
|
|
1830
|
+
Style/OpenStructUse:
|
|
1831
|
+
Description: Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged
|
|
1832
|
+
due to performance, version compatibility, and potential security issues.
|
|
1833
|
+
References:
|
|
1834
|
+
- https://docs.ruby-lang.org/en/3.0/OpenStruct.html#class-OpenStruct-label-Caveats
|
|
1835
|
+
Enabled: true # was pending
|
|
1836
|
+
Safe: false
|
|
1837
|
+
VersionAdded: '1.23'
|
|
1838
|
+
VersionChanged: '1.51'
|
|
1839
|
+
|
|
1840
|
+
# Supports --autocorrect
|
|
1841
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleoperatormethodcall
|
|
1842
|
+
Style/OperatorMethodCall:
|
|
1843
|
+
Description: Checks for redundant dot before operator method call.
|
|
1844
|
+
StyleGuide: "#operator-method-call"
|
|
1845
|
+
Enabled: true # was pending
|
|
1846
|
+
VersionAdded: '1.37'
|
|
1847
|
+
|
|
1848
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleoptionhash
|
|
1849
|
+
Style/OptionHash:
|
|
1850
|
+
Description: Don't use option hashes when you can use keyword arguments.
|
|
1851
|
+
StyleGuide: "#keyword-arguments-vs-option-hashes"
|
|
1852
|
+
Enabled: true # was false
|
|
1853
|
+
VersionAdded: '0.33'
|
|
1854
|
+
VersionChanged: '0.34'
|
|
1855
|
+
SuspiciousParamNames:
|
|
1856
|
+
- options
|
|
1857
|
+
- opts
|
|
1858
|
+
- args
|
|
1859
|
+
- params
|
|
1860
|
+
- parameters
|
|
1861
|
+
Allowlist: []
|
|
1862
|
+
|
|
1863
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleoptionalarguments
|
|
1864
|
+
Style/OptionalArguments:
|
|
1865
|
+
Description: Checks for optional arguments that do not appear at the end of the argument
|
|
1866
|
+
list.
|
|
1867
|
+
StyleGuide: "#optional-arguments"
|
|
1868
|
+
Enabled: true
|
|
1869
|
+
Safe: false
|
|
1870
|
+
VersionAdded: '0.33'
|
|
1871
|
+
VersionChanged: '0.83'
|
|
1872
|
+
|
|
1873
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleoptionalbooleanparameter
|
|
1874
|
+
Style/OptionalBooleanParameter:
|
|
1875
|
+
Description: Use keyword arguments when defining method with boolean argument.
|
|
1876
|
+
StyleGuide: "#boolean-keyword-arguments"
|
|
1877
|
+
Enabled: true
|
|
1878
|
+
Safe: false
|
|
1879
|
+
VersionAdded: '0.89'
|
|
1880
|
+
AllowedMethods:
|
|
1881
|
+
- respond_to_missing?
|
|
1882
|
+
|
|
1883
|
+
# Supports --autocorrect
|
|
1884
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleorassignment
|
|
1885
|
+
Style/OrAssignment:
|
|
1886
|
+
Description: Recommend usage of double pipe equals (||=) where applicable.
|
|
1887
|
+
StyleGuide: "#double-pipe-for-uninit"
|
|
1888
|
+
Enabled: true
|
|
1889
|
+
VersionAdded: '0.50'
|
|
1890
|
+
|
|
1891
|
+
# Supports --autocorrect
|
|
1892
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleparallelassignment
|
|
1893
|
+
Style/ParallelAssignment:
|
|
1894
|
+
Description: Check for simple usages of parallel assignment. It will only warn when
|
|
1895
|
+
the number of variables matches on both sides of the assignment.
|
|
1896
|
+
StyleGuide: "#parallel-assignment"
|
|
1897
|
+
Enabled: true
|
|
1898
|
+
VersionAdded: '0.32'
|
|
1899
|
+
|
|
1900
|
+
# Supports --autocorrect
|
|
1901
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleparenthesesaroundcondition
|
|
1902
|
+
Style/ParenthesesAroundCondition:
|
|
1903
|
+
Description: Don't use parentheses around the condition of an if/unless/while.
|
|
1904
|
+
StyleGuide: "#no-parens-around-condition"
|
|
1905
|
+
Enabled: true
|
|
1906
|
+
VersionAdded: '0.9'
|
|
1907
|
+
VersionChanged: '0.56'
|
|
1908
|
+
AllowSafeAssignment: true
|
|
1909
|
+
AllowInMultilineConditions: false
|
|
1910
|
+
|
|
1911
|
+
# Supports --autocorrect
|
|
1912
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylepercentliteraldelimiters
|
|
1913
|
+
Style/PercentLiteralDelimiters:
|
|
1914
|
+
Description: Use `%`-literal delimiters consistently.
|
|
1915
|
+
StyleGuide: "#percent-literal-braces"
|
|
1916
|
+
Enabled: true
|
|
1917
|
+
VersionAdded: '0.19'
|
|
1918
|
+
PreferredDelimiters:
|
|
1919
|
+
default: "()"
|
|
1920
|
+
"%i": "[]"
|
|
1921
|
+
"%I": "[]"
|
|
1922
|
+
"%r": "{}"
|
|
1923
|
+
"%w": "[]"
|
|
1924
|
+
"%W": "[]"
|
|
1925
|
+
VersionChanged: '0.48'
|
|
1926
|
+
|
|
1927
|
+
# Supports --autocorrect
|
|
1928
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylepercentqliterals
|
|
1929
|
+
Style/PercentQLiterals:
|
|
1930
|
+
Description: Checks if uses of %Q/%q match the configured preference.
|
|
1931
|
+
Enabled: true
|
|
1932
|
+
VersionAdded: '0.25'
|
|
1933
|
+
EnforcedStyle: lower_case_q
|
|
1934
|
+
SupportedStyles:
|
|
1935
|
+
- lower_case_q
|
|
1936
|
+
- upper_case_q
|
|
1937
|
+
|
|
1938
|
+
# Supports --autocorrect
|
|
1939
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleperlbackrefs
|
|
1940
|
+
Style/PerlBackrefs:
|
|
1941
|
+
Description: Avoid Perl-style regex back references.
|
|
1942
|
+
StyleGuide: "#no-perl-regexp-last-matchers"
|
|
1943
|
+
Enabled: true
|
|
1944
|
+
VersionAdded: '0.13'
|
|
1945
|
+
|
|
1946
|
+
# Supports --autocorrect
|
|
1947
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylepreferredhashmethods
|
|
1948
|
+
Style/PreferredHashMethods:
|
|
1949
|
+
Description: Checks use of `has_key?` and `has_value?` Hash methods.
|
|
1950
|
+
StyleGuide: "#hash-key"
|
|
1951
|
+
Enabled: true
|
|
1952
|
+
Safe: false
|
|
1953
|
+
VersionAdded: '0.41'
|
|
1954
|
+
VersionChanged: '0.70'
|
|
1955
|
+
EnforcedStyle: short
|
|
1956
|
+
SupportedStyles:
|
|
1957
|
+
- short
|
|
1958
|
+
- verbose
|
|
1959
|
+
|
|
1960
|
+
# Supports --autocorrect
|
|
1961
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleproc
|
|
1962
|
+
Style/Proc:
|
|
1963
|
+
Description: Use proc instead of Proc.new.
|
|
1964
|
+
StyleGuide: "#proc"
|
|
1965
|
+
Enabled: true
|
|
1966
|
+
VersionAdded: '0.9'
|
|
1967
|
+
VersionChanged: '0.18'
|
|
1968
|
+
|
|
1969
|
+
# Supports --autocorrect
|
|
1970
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylequotedsymbols
|
|
1971
|
+
Style/QuotedSymbols:
|
|
1972
|
+
Description: Use a consistent style for quoted symbols.
|
|
1973
|
+
Enabled: true # was pending
|
|
1974
|
+
VersionAdded: '1.16'
|
|
1975
|
+
EnforcedStyle: same_as_string_literals
|
|
1976
|
+
SupportedStyles:
|
|
1977
|
+
- same_as_string_literals
|
|
1978
|
+
- single_quotes
|
|
1979
|
+
- double_quotes
|
|
1980
|
+
|
|
1981
|
+
# Supports --autocorrect
|
|
1982
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleraiseargs
|
|
1983
|
+
Style/RaiseArgs:
|
|
1984
|
+
Description: Checks the arguments passed to raise/fail.
|
|
1985
|
+
StyleGuide: "#exception-class-messages"
|
|
1986
|
+
Enabled: true
|
|
1987
|
+
Safe: false
|
|
1988
|
+
VersionAdded: '0.14'
|
|
1989
|
+
VersionChanged: '1.61'
|
|
1990
|
+
EnforcedStyle: exploded
|
|
1991
|
+
SupportedStyles:
|
|
1992
|
+
- compact
|
|
1993
|
+
- exploded
|
|
1994
|
+
AllowedCompactTypes: []
|
|
1995
|
+
|
|
1996
|
+
# Supports --autocorrect
|
|
1997
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylerandomwithoffset
|
|
1998
|
+
Style/RandomWithOffset:
|
|
1999
|
+
Description: Prefer to use ranges when generating random numbers instead of integers
|
|
2000
|
+
with offsets.
|
|
2001
|
+
StyleGuide: "#random-numbers"
|
|
2002
|
+
Enabled: true
|
|
2003
|
+
VersionAdded: '0.52'
|
|
2004
|
+
|
|
2005
|
+
# Supports --autocorrect
|
|
2006
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantargument
|
|
2007
|
+
Style/RedundantArgument:
|
|
2008
|
+
Description: Checks for a redundant argument passed to certain methods.
|
|
2009
|
+
Enabled: true # was pending
|
|
2010
|
+
Safe: false
|
|
2011
|
+
VersionAdded: '1.4'
|
|
2012
|
+
VersionChanged: '1.55'
|
|
2013
|
+
Methods:
|
|
2014
|
+
join: ''
|
|
2015
|
+
sum: 0
|
|
2016
|
+
exit: true
|
|
2017
|
+
exit!: false
|
|
2018
|
+
split: " "
|
|
2019
|
+
chomp: "\n"
|
|
2020
|
+
chomp!: "\n"
|
|
2021
|
+
|
|
2022
|
+
# Supports --autocorrect
|
|
2023
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantarrayconstructor
|
|
2024
|
+
Style/RedundantArrayConstructor:
|
|
2025
|
+
Description: Checks for the instantiation of array using redundant `Array` constructor.
|
|
2026
|
+
Enabled: true # was pending
|
|
2027
|
+
VersionAdded: '1.52'
|
|
2028
|
+
|
|
2029
|
+
# Supports --autocorrect
|
|
2030
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantarrayflatten
|
|
2031
|
+
Style/RedundantArrayFlatten:
|
|
2032
|
+
Description: Checks for redundant calls of `Array#flatten`.
|
|
2033
|
+
Enabled: true # was pending
|
|
2034
|
+
Safe: false
|
|
2035
|
+
VersionAdded: '1.76'
|
|
2036
|
+
|
|
2037
|
+
# Supports --autocorrect
|
|
2038
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantassignment
|
|
2039
|
+
Style/RedundantAssignment:
|
|
2040
|
+
Description: Checks for redundant assignment before returning.
|
|
2041
|
+
Enabled: true
|
|
2042
|
+
VersionAdded: '0.87'
|
|
2043
|
+
|
|
2044
|
+
# Supports --autocorrect
|
|
2045
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantbegin
|
|
2046
|
+
Style/RedundantBegin:
|
|
2047
|
+
Description: Don't use begin blocks when they are not needed.
|
|
2048
|
+
StyleGuide: "#begin-implicit"
|
|
2049
|
+
Enabled: true
|
|
2050
|
+
VersionAdded: '0.10'
|
|
2051
|
+
VersionChanged: '0.21'
|
|
2052
|
+
|
|
2053
|
+
# Supports --autocorrect
|
|
2054
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantcapitalw
|
|
2055
|
+
Style/RedundantCapitalW:
|
|
2056
|
+
Description: Checks for %W when interpolation is not needed.
|
|
2057
|
+
Enabled: true
|
|
2058
|
+
VersionAdded: '0.76'
|
|
2059
|
+
|
|
2060
|
+
# Supports --autocorrect
|
|
2061
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantcondition
|
|
2062
|
+
Style/RedundantCondition:
|
|
2063
|
+
Description: Checks for unnecessary conditional expressions.
|
|
2064
|
+
Enabled: true
|
|
2065
|
+
VersionAdded: '0.76'
|
|
2066
|
+
VersionChanged: '1.73'
|
|
2067
|
+
AllowedMethods:
|
|
2068
|
+
- nonzero?
|
|
2069
|
+
|
|
2070
|
+
# Supports --autocorrect
|
|
2071
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantconditional
|
|
2072
|
+
Style/RedundantConditional:
|
|
2073
|
+
Description: Don't return true/false from a conditional.
|
|
2074
|
+
Enabled: true
|
|
2075
|
+
VersionAdded: '0.50'
|
|
2076
|
+
|
|
2077
|
+
# Supports --autocorrect
|
|
2078
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantconstantbase
|
|
2079
|
+
Style/RedundantConstantBase:
|
|
2080
|
+
Description: Avoid redundant `::` prefix on constant.
|
|
2081
|
+
Enabled: true # was pending
|
|
2082
|
+
VersionAdded: '1.40'
|
|
2083
|
+
|
|
2084
|
+
# Supports --autocorrect
|
|
2085
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantcurrentdirectoryinpath
|
|
2086
|
+
Style/RedundantCurrentDirectoryInPath:
|
|
2087
|
+
Description: Checks for a redundant current directory in a path given to `require_relative`.
|
|
2088
|
+
Enabled: true # was pending
|
|
2089
|
+
VersionAdded: '1.53'
|
|
2090
|
+
|
|
2091
|
+
# Supports --autocorrect
|
|
2092
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantdoublesplathashbraces
|
|
2093
|
+
Style/RedundantDoubleSplatHashBraces:
|
|
2094
|
+
Description: Checks for redundant uses of double splat hash braces.
|
|
2095
|
+
Enabled: true # was pending
|
|
2096
|
+
VersionAdded: '1.41'
|
|
2097
|
+
|
|
2098
|
+
# Supports --autocorrect
|
|
2099
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundanteach
|
|
2100
|
+
Style/RedundantEach:
|
|
2101
|
+
Description: Checks for redundant `each`.
|
|
2102
|
+
Enabled: true # was pending
|
|
2103
|
+
Safe: false
|
|
2104
|
+
VersionAdded: '1.38'
|
|
2105
|
+
|
|
2106
|
+
# Supports --autocorrect
|
|
2107
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantexception
|
|
2108
|
+
Style/RedundantException:
|
|
2109
|
+
Description: Checks for an obsolete RuntimeException argument in raise/fail.
|
|
2110
|
+
StyleGuide: "#no-explicit-runtimeerror"
|
|
2111
|
+
Enabled: true
|
|
2112
|
+
VersionAdded: '0.14'
|
|
2113
|
+
VersionChanged: '0.29'
|
|
2114
|
+
|
|
2115
|
+
# Supports --autocorrect
|
|
2116
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantfetchblock
|
|
2117
|
+
Style/RedundantFetchBlock:
|
|
2118
|
+
Description: Use `fetch(key, value)` instead of `fetch(key) { value }` when value
|
|
2119
|
+
has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or
|
|
2120
|
+
is a constant.
|
|
2121
|
+
References:
|
|
2122
|
+
- https://github.com/fastruby/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code
|
|
2123
|
+
Enabled: true
|
|
2124
|
+
Safe: false
|
|
2125
|
+
SafeForConstants: false
|
|
2126
|
+
VersionAdded: '0.86'
|
|
2127
|
+
|
|
2128
|
+
# Supports --autocorrect
|
|
2129
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantfileextensioninrequire
|
|
2130
|
+
Style/RedundantFileExtensionInRequire:
|
|
2131
|
+
Description: Checks for the presence of superfluous `.rb` extension in the filename
|
|
2132
|
+
provided to `require` and `require_relative`.
|
|
2133
|
+
StyleGuide: "#no-explicit-rb-to-require"
|
|
2134
|
+
Enabled: true
|
|
2135
|
+
VersionAdded: '0.88'
|
|
2136
|
+
|
|
2137
|
+
# Supports --autocorrect
|
|
2138
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantfilterchain
|
|
2139
|
+
Style/RedundantFilterChain:
|
|
2140
|
+
Description: Identifies usages of `any?`, `empty?`, `none?` or `one?` predicate methods
|
|
2141
|
+
chained to `select`/`filter`/`find_all` and change them to use predicate method
|
|
2142
|
+
instead.
|
|
2143
|
+
Enabled: true # was pending
|
|
2144
|
+
SafeAutoCorrect: false
|
|
2145
|
+
VersionAdded: '1.52'
|
|
2146
|
+
VersionChanged: '1.57'
|
|
2147
|
+
|
|
2148
|
+
# Supports --autocorrect
|
|
2149
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantformat
|
|
2150
|
+
Style/RedundantFormat:
|
|
2151
|
+
Description: Checks for usages of `Kernel#format` or `Kernel#sprintf` with only a
|
|
2152
|
+
single argument.
|
|
2153
|
+
Enabled: true # was pending
|
|
2154
|
+
SafeAutoCorrect: false
|
|
2155
|
+
VersionAdded: '1.72'
|
|
2156
|
+
VersionChanged: '1.72'
|
|
2157
|
+
|
|
2158
|
+
# Supports --autocorrect
|
|
2159
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantfreeze
|
|
2160
|
+
Style/RedundantFreeze:
|
|
2161
|
+
Description: Checks usages of Object#freeze on immutable objects.
|
|
2162
|
+
Enabled: true
|
|
2163
|
+
VersionAdded: '0.34'
|
|
2164
|
+
VersionChanged: '0.66'
|
|
2165
|
+
|
|
2166
|
+
# Supports --autocorrect
|
|
2167
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantheredocdelimiterquotes
|
|
2168
|
+
Style/RedundantHeredocDelimiterQuotes:
|
|
2169
|
+
Description: Checks for redundant heredoc delimiter quotes.
|
|
2170
|
+
Enabled: true # was pending
|
|
2171
|
+
VersionAdded: '1.45'
|
|
2172
|
+
|
|
2173
|
+
# Supports --autocorrect
|
|
2174
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantinitialize
|
|
2175
|
+
Style/RedundantInitialize:
|
|
2176
|
+
Description: Checks for redundant `initialize` methods.
|
|
2177
|
+
Enabled: true # was pending
|
|
2178
|
+
AutoCorrect: contextual
|
|
2179
|
+
Safe: false
|
|
2180
|
+
AllowComments: true
|
|
2181
|
+
VersionAdded: '1.27'
|
|
2182
|
+
VersionChanged: '1.61'
|
|
2183
|
+
|
|
2184
|
+
# Supports --autocorrect
|
|
2185
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantinterpolation
|
|
2186
|
+
Style/RedundantInterpolation:
|
|
2187
|
+
Description: Checks for strings that are just an interpolated expression.
|
|
2188
|
+
Enabled: true
|
|
2189
|
+
SafeAutoCorrect: false
|
|
2190
|
+
VersionAdded: '0.76'
|
|
2191
|
+
VersionChanged: '1.30'
|
|
2192
|
+
|
|
2193
|
+
# Supports --autocorrect
|
|
2194
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantinterpolationunfreeze
|
|
2195
|
+
Style/RedundantInterpolationUnfreeze:
|
|
2196
|
+
Description: Checks for redundant unfreezing of interpolated strings.
|
|
2197
|
+
Enabled: true # was pending
|
|
2198
|
+
VersionAdded: '1.66'
|
|
2199
|
+
|
|
2200
|
+
# Supports --autocorrect
|
|
2201
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantlinecontinuation
|
|
2202
|
+
Style/RedundantLineContinuation:
|
|
2203
|
+
Description: Checks for redundant line continuation.
|
|
2204
|
+
Enabled: true # was pending
|
|
2205
|
+
VersionAdded: '1.49'
|
|
2206
|
+
|
|
2207
|
+
# Supports --autocorrect
|
|
2208
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantparentheses
|
|
2209
|
+
Style/RedundantParentheses:
|
|
2210
|
+
Description: Checks for parentheses that seem not to serve any purpose.
|
|
2211
|
+
Enabled: true
|
|
2212
|
+
VersionAdded: '0.36'
|
|
2213
|
+
|
|
2214
|
+
# Supports --autocorrect
|
|
2215
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantpercentq
|
|
2216
|
+
Style/RedundantPercentQ:
|
|
2217
|
+
Description: Checks for %q/%Q when single quotes or double quotes would do.
|
|
2218
|
+
StyleGuide: "#percent-q"
|
|
2219
|
+
Enabled: true
|
|
2220
|
+
VersionAdded: '0.76'
|
|
2221
|
+
|
|
2222
|
+
# Supports --autocorrect
|
|
2223
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantregexpargument
|
|
2224
|
+
Style/RedundantRegexpArgument:
|
|
2225
|
+
Description: Identifies places where argument can be replaced from a deterministic
|
|
2226
|
+
regexp to a string.
|
|
2227
|
+
Enabled: true # was pending
|
|
2228
|
+
VersionAdded: '1.53'
|
|
2229
|
+
|
|
2230
|
+
# Supports --autocorrect
|
|
2231
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantregexpcharacterclass
|
|
2232
|
+
Style/RedundantRegexpCharacterClass:
|
|
2233
|
+
Description: Checks for unnecessary single-element Regexp character classes.
|
|
2234
|
+
Enabled: true
|
|
2235
|
+
VersionAdded: '0.85'
|
|
2236
|
+
|
|
2237
|
+
# Supports --autocorrect
|
|
2238
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantregexpconstructor
|
|
2239
|
+
Style/RedundantRegexpConstructor:
|
|
2240
|
+
Description: Checks for the instantiation of regexp using redundant `Regexp.new` or
|
|
2241
|
+
`Regexp.compile`.
|
|
2242
|
+
Enabled: true # was pending
|
|
2243
|
+
VersionAdded: '1.52'
|
|
2244
|
+
|
|
2245
|
+
# Supports --autocorrect
|
|
2246
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantregexpescape
|
|
2247
|
+
Style/RedundantRegexpEscape:
|
|
2248
|
+
Description: Checks for redundant escapes in Regexps.
|
|
2249
|
+
Enabled: true
|
|
2250
|
+
VersionAdded: '0.85'
|
|
2251
|
+
|
|
2252
|
+
# Supports --autocorrect
|
|
2253
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantreturn
|
|
2254
|
+
Style/RedundantReturn:
|
|
2255
|
+
Description: Don't use return where it's not required.
|
|
2256
|
+
StyleGuide: "#no-explicit-return"
|
|
2257
|
+
Enabled: true
|
|
2258
|
+
VersionAdded: '0.10'
|
|
2259
|
+
VersionChanged: '0.14'
|
|
2260
|
+
AllowMultipleReturnValues: false
|
|
2261
|
+
|
|
2262
|
+
# Supports --autocorrect
|
|
2263
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantself
|
|
2264
|
+
Style/RedundantSelf:
|
|
2265
|
+
Description: Don't use self where it's not needed.
|
|
2266
|
+
StyleGuide: "#no-self-unless-required"
|
|
2267
|
+
Enabled: true
|
|
2268
|
+
VersionAdded: '0.10'
|
|
2269
|
+
VersionChanged: '0.13'
|
|
2270
|
+
|
|
2271
|
+
# Supports --autocorrect
|
|
2272
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantselfassignment
|
|
2273
|
+
Style/RedundantSelfAssignment:
|
|
2274
|
+
Description: Checks for places where redundant assignments are made for in place modification
|
|
2275
|
+
methods.
|
|
2276
|
+
Enabled: true
|
|
2277
|
+
Safe: false
|
|
2278
|
+
VersionAdded: '0.90'
|
|
2279
|
+
|
|
2280
|
+
# Supports --autocorrect
|
|
2281
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantselfassignmentbranch
|
|
2282
|
+
Style/RedundantSelfAssignmentBranch:
|
|
2283
|
+
Description: Checks for places where conditional branch makes redundant self-assignment.
|
|
2284
|
+
Enabled: true # was pending
|
|
2285
|
+
VersionAdded: '1.19'
|
|
2286
|
+
|
|
2287
|
+
# Supports --autocorrect
|
|
2288
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantsort
|
|
2289
|
+
Style/RedundantSort:
|
|
2290
|
+
Description: Use `min` instead of `sort.first`, `max_by` instead of `sort_by...last`,
|
|
2291
|
+
etc.
|
|
2292
|
+
Enabled: true
|
|
2293
|
+
VersionAdded: '0.76'
|
|
2294
|
+
VersionChanged: '1.22'
|
|
2295
|
+
Safe: false
|
|
2296
|
+
|
|
2297
|
+
# Supports --autocorrect
|
|
2298
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantsortby
|
|
2299
|
+
Style/RedundantSortBy:
|
|
2300
|
+
Description: Use `sort` instead of `sort_by { |x| x }`.
|
|
2301
|
+
Enabled: true
|
|
2302
|
+
VersionAdded: '0.36'
|
|
2303
|
+
|
|
2304
|
+
# Supports --autocorrect
|
|
2305
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantstringescape
|
|
2306
|
+
Style/RedundantStringEscape:
|
|
2307
|
+
Description: Checks for redundant escapes in string literals.
|
|
2308
|
+
Enabled: true # was pending
|
|
2309
|
+
VersionAdded: '1.37'
|
|
2310
|
+
|
|
2311
|
+
# Supports --autocorrect
|
|
2312
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleregexpliteral
|
|
2313
|
+
Style/RegexpLiteral:
|
|
2314
|
+
Description: Use / or %r around regular expressions.
|
|
2315
|
+
StyleGuide: "#percent-r"
|
|
2316
|
+
Enabled: true
|
|
2317
|
+
VersionAdded: '0.9'
|
|
2318
|
+
VersionChanged: '0.30'
|
|
2319
|
+
EnforcedStyle: slashes
|
|
2320
|
+
SupportedStyles:
|
|
2321
|
+
- slashes
|
|
2322
|
+
- percent_r
|
|
2323
|
+
- mixed
|
|
2324
|
+
AllowInnerSlashes: false
|
|
2325
|
+
|
|
2326
|
+
# Supports --autocorrect
|
|
2327
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylerequireorder
|
|
2328
|
+
Style/RequireOrder:
|
|
2329
|
+
Description: Sort `require` and `require_relative` in alphabetical order.
|
|
2330
|
+
Enabled: true # was false
|
|
2331
|
+
SafeAutoCorrect: false
|
|
2332
|
+
VersionAdded: '1.40'
|
|
2333
|
+
|
|
2334
|
+
# Supports --autocorrect
|
|
2335
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylerescuemodifier
|
|
2336
|
+
Style/RescueModifier:
|
|
2337
|
+
Description: Avoid using rescue in its modifier form.
|
|
2338
|
+
StyleGuide: "#no-rescue-modifiers"
|
|
2339
|
+
Enabled: true
|
|
2340
|
+
VersionAdded: '0.9'
|
|
2341
|
+
VersionChanged: '0.34'
|
|
2342
|
+
|
|
2343
|
+
# Supports --autocorrect
|
|
2344
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylerescuestandarderror
|
|
2345
|
+
Style/RescueStandardError:
|
|
2346
|
+
Description: Avoid rescuing without specifying an error class.
|
|
2347
|
+
Enabled: true
|
|
2348
|
+
VersionAdded: '0.52'
|
|
2349
|
+
EnforcedStyle: explicit
|
|
2350
|
+
SupportedStyles:
|
|
2351
|
+
- implicit
|
|
2352
|
+
- explicit
|
|
2353
|
+
|
|
2354
|
+
# Supports --autocorrect
|
|
2355
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylereturnnil
|
|
2356
|
+
Style/ReturnNil:
|
|
2357
|
+
Description: Use return instead of return nil.
|
|
2358
|
+
Enabled: true # was false
|
|
2359
|
+
EnforcedStyle: return
|
|
2360
|
+
SupportedStyles:
|
|
2361
|
+
- return
|
|
2362
|
+
- return_nil
|
|
2363
|
+
VersionAdded: '0.50'
|
|
2364
|
+
|
|
2365
|
+
# Supports --autocorrect
|
|
2366
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylereturnnilinpredicatemethoddefinition
|
|
2367
|
+
Style/ReturnNilInPredicateMethodDefinition:
|
|
2368
|
+
Description: Checks if uses of `return` or `return nil` in predicate method definition.
|
|
2369
|
+
StyleGuide: "#bool-methods-qmark"
|
|
2370
|
+
Enabled: true # was pending
|
|
2371
|
+
SafeAutoCorrect: false
|
|
2372
|
+
AllowedMethods: []
|
|
2373
|
+
AllowedPatterns: []
|
|
2374
|
+
VersionAdded: '1.53'
|
|
2375
|
+
VersionChanged: '1.67'
|
|
2376
|
+
|
|
2377
|
+
# Supports --autocorrect
|
|
2378
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesafenavigation
|
|
2379
|
+
Style/SafeNavigation:
|
|
2380
|
+
Description: Transforms usages of a method call safeguarded by a check for the existence
|
|
2381
|
+
of the object to safe navigation (`&.`). Autocorrection is unsafe as it assumes
|
|
2382
|
+
the object will be `nil` or truthy, but never `false`.
|
|
2383
|
+
Enabled: true
|
|
2384
|
+
VersionAdded: '0.43'
|
|
2385
|
+
VersionChanged: '1.67'
|
|
2386
|
+
ConvertCodeThatCanStartToReturnNil: false
|
|
2387
|
+
AllowedMethods:
|
|
2388
|
+
- present?
|
|
2389
|
+
- blank?
|
|
2390
|
+
- presence
|
|
2391
|
+
- try
|
|
2392
|
+
- try!
|
|
2393
|
+
SafeAutoCorrect: false
|
|
2394
|
+
MaxChainLength: 2
|
|
2395
|
+
|
|
2396
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesafenavigationchainlength
|
|
2397
|
+
Style/SafeNavigationChainLength:
|
|
2398
|
+
Description: Enforces safe navigation chains length to not exceed the configured maximum.
|
|
2399
|
+
StyleGuide: "#safe-navigation"
|
|
2400
|
+
Enabled: true # was pending
|
|
2401
|
+
VersionAdded: '1.68'
|
|
2402
|
+
Max: 2
|
|
2403
|
+
|
|
2404
|
+
# Supports --autocorrect
|
|
2405
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesample
|
|
2406
|
+
Style/Sample:
|
|
2407
|
+
Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`.
|
|
2408
|
+
References:
|
|
2409
|
+
- https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code
|
|
2410
|
+
Enabled: true
|
|
2411
|
+
VersionAdded: '0.30'
|
|
2412
|
+
|
|
2413
|
+
# Supports --autocorrect
|
|
2414
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleselectbyregexp
|
|
2415
|
+
Style/SelectByRegexp:
|
|
2416
|
+
Description: Prefer grep/grep_v to select/reject with a regexp match.
|
|
2417
|
+
Enabled: true # was pending
|
|
2418
|
+
SafeAutoCorrect: false
|
|
2419
|
+
VersionAdded: '1.22'
|
|
2420
|
+
|
|
2421
|
+
# Supports --autocorrect
|
|
2422
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleselfassignment
|
|
2423
|
+
Style/SelfAssignment:
|
|
2424
|
+
Description: Checks for places where self-assignment shorthand should have been used.
|
|
2425
|
+
StyleGuide: "#self-assignment"
|
|
2426
|
+
Enabled: true
|
|
2427
|
+
VersionAdded: '0.19'
|
|
2428
|
+
VersionChanged: '0.29'
|
|
2429
|
+
|
|
2430
|
+
# Supports --autocorrect
|
|
2431
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesemicolon
|
|
2432
|
+
Style/Semicolon:
|
|
2433
|
+
Description: Don't use semicolons to terminate expressions.
|
|
2434
|
+
StyleGuide: "#no-semicolon"
|
|
2435
|
+
Enabled: true
|
|
2436
|
+
VersionAdded: '0.9'
|
|
2437
|
+
VersionChanged: '0.19'
|
|
2438
|
+
AllowAsExpressionSeparator: false
|
|
2439
|
+
|
|
2440
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesend
|
|
2441
|
+
Style/Send:
|
|
2442
|
+
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
|
2443
|
+
may overlap with existing methods.
|
|
2444
|
+
StyleGuide: "#prefer-public-send"
|
|
2445
|
+
Enabled: true # was false
|
|
2446
|
+
VersionAdded: '0.33'
|
|
2447
|
+
|
|
2448
|
+
# Supports --autocorrect
|
|
2449
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesendwithliteralmethodname
|
|
2450
|
+
Style/SendWithLiteralMethodName:
|
|
2451
|
+
Description: Detects the use of the `public_send` method with a static method name
|
|
2452
|
+
argument.
|
|
2453
|
+
Enabled: true # was pending
|
|
2454
|
+
Safe: false
|
|
2455
|
+
AllowSend: true
|
|
2456
|
+
VersionAdded: '1.64'
|
|
2457
|
+
|
|
2458
|
+
# Supports --autocorrect
|
|
2459
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesignalexception
|
|
2460
|
+
Style/SignalException:
|
|
2461
|
+
Description: Checks for proper usage of fail and raise.
|
|
2462
|
+
StyleGuide: "#prefer-raise-over-fail"
|
|
2463
|
+
Enabled: true
|
|
2464
|
+
VersionAdded: '0.11'
|
|
2465
|
+
VersionChanged: '0.37'
|
|
2466
|
+
EnforcedStyle: only_raise
|
|
2467
|
+
SupportedStyles:
|
|
2468
|
+
- only_raise
|
|
2469
|
+
- only_fail
|
|
2470
|
+
- semantic
|
|
2471
|
+
|
|
2472
|
+
# Supports --autocorrect
|
|
2473
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesingleargumentdig
|
|
2474
|
+
Style/SingleArgumentDig:
|
|
2475
|
+
Description: Avoid using single argument dig method.
|
|
2476
|
+
Enabled: true
|
|
2477
|
+
VersionAdded: '0.89'
|
|
2478
|
+
Safe: false
|
|
2479
|
+
|
|
2480
|
+
# Supports --autocorrect
|
|
2481
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesinglelineblockparams
|
|
2482
|
+
Style/SingleLineBlockParams:
|
|
2483
|
+
Description: Enforces the names of some block params.
|
|
2484
|
+
Enabled: true # was false
|
|
2485
|
+
VersionAdded: '0.16'
|
|
2486
|
+
VersionChanged: '1.6'
|
|
2487
|
+
Methods:
|
|
2488
|
+
- reduce:
|
|
2489
|
+
- acc
|
|
2490
|
+
- elem
|
|
2491
|
+
- inject:
|
|
2492
|
+
- acc
|
|
2493
|
+
- elem
|
|
2494
|
+
|
|
2495
|
+
# Supports --autocorrect
|
|
2496
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesinglelinedoendblock
|
|
2497
|
+
Style/SingleLineDoEndBlock:
|
|
2498
|
+
Description: Checks for single-line `do`...`end` blocks.
|
|
2499
|
+
StyleGuide: "#single-line-do-end-block"
|
|
2500
|
+
Enabled: true # was pending
|
|
2501
|
+
VersionAdded: '1.57'
|
|
2502
|
+
|
|
2503
|
+
# Supports --autocorrect
|
|
2504
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesinglelinemethods
|
|
2505
|
+
Style/SingleLineMethods:
|
|
2506
|
+
Description: Avoid single-line methods.
|
|
2507
|
+
StyleGuide: "#no-single-line-methods"
|
|
2508
|
+
Enabled: true
|
|
2509
|
+
VersionAdded: '0.9'
|
|
2510
|
+
VersionChanged: '1.8'
|
|
2511
|
+
AllowIfMethodIsEmpty: true
|
|
2512
|
+
|
|
2513
|
+
# Supports --autocorrect
|
|
2514
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleslicingwithrange
|
|
2515
|
+
Style/SlicingWithRange:
|
|
2516
|
+
Description: Checks array slicing is done with redundant, endless, and beginless ranges
|
|
2517
|
+
when suitable.
|
|
2518
|
+
StyleGuide: "#slicing-with-ranges"
|
|
2519
|
+
Enabled: true
|
|
2520
|
+
VersionAdded: '0.83'
|
|
2521
|
+
Safe: false
|
|
2522
|
+
|
|
2523
|
+
# Supports --autocorrect
|
|
2524
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesolenestedconditional
|
|
2525
|
+
Style/SoleNestedConditional:
|
|
2526
|
+
Description: Finds sole nested conditional nodes which can be merged into outer conditional
|
|
2527
|
+
node.
|
|
2528
|
+
Enabled: true
|
|
2529
|
+
VersionAdded: '0.89'
|
|
2530
|
+
VersionChanged: '1.5'
|
|
2531
|
+
AllowModifier: false
|
|
2532
|
+
|
|
2533
|
+
# Supports --autocorrect
|
|
2534
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylespecialglobalvars
|
|
2535
|
+
Style/SpecialGlobalVars:
|
|
2536
|
+
Description: Avoid Perl-style global variables.
|
|
2537
|
+
StyleGuide: "#no-cryptic-perlisms"
|
|
2538
|
+
Enabled: true
|
|
2539
|
+
VersionAdded: '0.13'
|
|
2540
|
+
VersionChanged: '0.36'
|
|
2541
|
+
SafeAutoCorrect: false
|
|
2542
|
+
RequireEnglish: true
|
|
2543
|
+
EnforcedStyle: use_english_names
|
|
2544
|
+
SupportedStyles:
|
|
2545
|
+
- use_perl_names
|
|
2546
|
+
- use_english_names
|
|
2547
|
+
- use_builtin_english_names
|
|
2548
|
+
|
|
2549
|
+
# Supports --autocorrect
|
|
2550
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestabbylambdaparentheses
|
|
2551
|
+
Style/StabbyLambdaParentheses:
|
|
2552
|
+
Description: Checks for the usage of parentheses around stabby lambda arguments.
|
|
2553
|
+
StyleGuide: "#stabby-lambda-with-args"
|
|
2554
|
+
Enabled: true
|
|
2555
|
+
VersionAdded: '0.35'
|
|
2556
|
+
EnforcedStyle: require_parentheses
|
|
2557
|
+
SupportedStyles:
|
|
2558
|
+
- require_parentheses
|
|
2559
|
+
- require_no_parentheses
|
|
2560
|
+
|
|
2561
|
+
# Supports --autocorrect
|
|
2562
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestaticclass
|
|
2563
|
+
Style/StaticClass:
|
|
2564
|
+
Description: Prefer modules to classes with only class methods.
|
|
2565
|
+
StyleGuide: "#modules-vs-classes"
|
|
2566
|
+
Enabled: true # was false
|
|
2567
|
+
Safe: false
|
|
2568
|
+
VersionAdded: '1.3'
|
|
2569
|
+
|
|
2570
|
+
# Supports --autocorrect
|
|
2571
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestderrputs
|
|
2572
|
+
Style/StderrPuts:
|
|
2573
|
+
Description: Use `warn` instead of `$stderr.puts`.
|
|
2574
|
+
StyleGuide: "#warn"
|
|
2575
|
+
Enabled: true
|
|
2576
|
+
VersionAdded: '0.51'
|
|
2577
|
+
|
|
2578
|
+
# Supports --autocorrect
|
|
2579
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestringchars
|
|
2580
|
+
Style/StringChars:
|
|
2581
|
+
Description: Checks for uses of `String#split` with empty string or regexp literal
|
|
2582
|
+
argument.
|
|
2583
|
+
StyleGuide: "#string-chars"
|
|
2584
|
+
Enabled: true # was pending
|
|
2585
|
+
Safe: false
|
|
2586
|
+
VersionAdded: '1.12'
|
|
2587
|
+
|
|
2588
|
+
# Supports --autocorrect
|
|
2589
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestringconcatenation
|
|
2590
|
+
Style/StringConcatenation:
|
|
2591
|
+
Description: Checks for places where string concatenation can be replaced with string
|
|
2592
|
+
interpolation.
|
|
2593
|
+
StyleGuide: "#string-interpolation"
|
|
2594
|
+
Enabled: true
|
|
2595
|
+
Safe: false
|
|
2596
|
+
VersionAdded: '0.89'
|
|
2597
|
+
VersionChanged: '1.18'
|
|
2598
|
+
Mode: aggressive
|
|
2599
|
+
|
|
2600
|
+
# Supports --autocorrect
|
|
2601
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestringhashkeys
|
|
2602
|
+
Style/StringHashKeys:
|
|
2603
|
+
Description: Prefer symbols instead of strings as hash keys.
|
|
2604
|
+
StyleGuide: "#symbols-as-keys"
|
|
2605
|
+
Enabled: true # was false
|
|
2606
|
+
VersionAdded: '0.52'
|
|
2607
|
+
VersionChanged: '0.75'
|
|
2608
|
+
Safe: false
|
|
2609
|
+
|
|
2610
|
+
# Supports --autocorrect
|
|
2611
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestringliterals
|
|
2612
|
+
Style/StringLiterals:
|
|
2613
|
+
Description: Checks if uses of quotes match the configured preference.
|
|
2614
|
+
StyleGuide: "#consistent-string-literals"
|
|
2615
|
+
Enabled: true
|
|
2616
|
+
VersionAdded: '0.9'
|
|
2617
|
+
VersionChanged: '0.36'
|
|
2618
|
+
EnforcedStyle: single_quotes
|
|
2619
|
+
SupportedStyles:
|
|
2620
|
+
- single_quotes
|
|
2621
|
+
- double_quotes
|
|
2622
|
+
ConsistentQuotesInMultiline: false
|
|
2623
|
+
|
|
2624
|
+
# Supports --autocorrect
|
|
2625
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestringliteralsininterpolation
|
|
2626
|
+
Style/StringLiteralsInInterpolation:
|
|
2627
|
+
Description: Checks if uses of quotes inside expressions in interpolated strings match
|
|
2628
|
+
the configured preference.
|
|
2629
|
+
Enabled: true
|
|
2630
|
+
VersionAdded: '0.27'
|
|
2631
|
+
EnforcedStyle: single_quotes
|
|
2632
|
+
SupportedStyles:
|
|
2633
|
+
- single_quotes
|
|
2634
|
+
- double_quotes
|
|
2635
|
+
|
|
2636
|
+
# Supports --autocorrect
|
|
2637
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestringmethods
|
|
2638
|
+
Style/StringMethods:
|
|
2639
|
+
Description: Checks if configured preferred methods are used over non-preferred.
|
|
2640
|
+
Enabled: true # was false
|
|
2641
|
+
VersionAdded: '0.34'
|
|
2642
|
+
VersionChanged: '0.34'
|
|
2643
|
+
PreferredMethods:
|
|
2644
|
+
intern: to_sym
|
|
2645
|
+
|
|
2646
|
+
# Supports --autocorrect
|
|
2647
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestrip
|
|
2648
|
+
Style/Strip:
|
|
2649
|
+
Description: Use `strip` instead of `lstrip.rstrip`.
|
|
2650
|
+
Enabled: true
|
|
2651
|
+
VersionAdded: '0.36'
|
|
2652
|
+
|
|
2653
|
+
# Supports --autocorrect
|
|
2654
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylestructinheritance
|
|
2655
|
+
Style/StructInheritance:
|
|
2656
|
+
Description: Checks for inheritance from Struct.new.
|
|
2657
|
+
StyleGuide: "#no-extend-struct-new"
|
|
2658
|
+
Enabled: true
|
|
2659
|
+
SafeAutoCorrect: false
|
|
2660
|
+
VersionAdded: '0.29'
|
|
2661
|
+
VersionChanged: '1.20'
|
|
2662
|
+
|
|
2663
|
+
# Supports --autocorrect
|
|
2664
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesuperarguments
|
|
2665
|
+
Style/SuperArguments:
|
|
2666
|
+
Description: Call `super` without arguments and parentheses when the signature is
|
|
2667
|
+
identical.
|
|
2668
|
+
Enabled: true # was pending
|
|
2669
|
+
VersionAdded: '1.64'
|
|
2670
|
+
|
|
2671
|
+
# Supports --autocorrect
|
|
2672
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesuperwithargsparentheses
|
|
2673
|
+
Style/SuperWithArgsParentheses:
|
|
2674
|
+
Description: Use parentheses for `super` with arguments.
|
|
2675
|
+
StyleGuide: "#super-with-args"
|
|
2676
|
+
Enabled: true # was pending
|
|
2677
|
+
VersionAdded: '1.58'
|
|
2678
|
+
|
|
2679
|
+
# Supports --autocorrect
|
|
2680
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleswapvalues
|
|
2681
|
+
Style/SwapValues:
|
|
2682
|
+
Description: Enforces the use of shorthand-style swapping of 2 variables.
|
|
2683
|
+
StyleGuide: "#values-swapping"
|
|
2684
|
+
Enabled: true # was pending
|
|
2685
|
+
VersionAdded: '1.1'
|
|
2686
|
+
SafeAutoCorrect: false
|
|
2687
|
+
|
|
2688
|
+
# Supports --autocorrect
|
|
2689
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesymbolarray
|
|
2690
|
+
Style/SymbolArray:
|
|
2691
|
+
Description: Use %i or %I for arrays of symbols.
|
|
2692
|
+
StyleGuide: "#percent-i"
|
|
2693
|
+
Enabled: true
|
|
2694
|
+
VersionAdded: '0.9'
|
|
2695
|
+
VersionChanged: '0.49'
|
|
2696
|
+
EnforcedStyle: percent
|
|
2697
|
+
MinSize: 2
|
|
2698
|
+
SupportedStyles:
|
|
2699
|
+
- percent
|
|
2700
|
+
- brackets
|
|
2701
|
+
|
|
2702
|
+
# Supports --autocorrect
|
|
2703
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesymbolliteral
|
|
2704
|
+
Style/SymbolLiteral:
|
|
2705
|
+
Description: Use plain symbols instead of string symbols when possible.
|
|
2706
|
+
Enabled: true
|
|
2707
|
+
VersionAdded: '0.30'
|
|
2708
|
+
|
|
2709
|
+
# Supports --autocorrect
|
|
2710
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylesymbolproc
|
|
2711
|
+
Style/SymbolProc:
|
|
2712
|
+
Description: Use symbols as procs instead of blocks when possible.
|
|
2713
|
+
Enabled: true
|
|
2714
|
+
Safe: false
|
|
2715
|
+
VersionAdded: '0.26'
|
|
2716
|
+
VersionChanged: '1.64'
|
|
2717
|
+
AllowMethodsWithArguments: false
|
|
2718
|
+
AllowedMethods:
|
|
2719
|
+
- define_method
|
|
2720
|
+
AllowedPatterns: []
|
|
2721
|
+
AllowComments: false
|
|
2722
|
+
|
|
2723
|
+
# Supports --autocorrect
|
|
2724
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleternaryparentheses
|
|
2725
|
+
Style/TernaryParentheses:
|
|
2726
|
+
Description: Checks for use of parentheses around ternary conditions.
|
|
2727
|
+
Enabled: true
|
|
2728
|
+
VersionAdded: '0.42'
|
|
2729
|
+
VersionChanged: '0.46'
|
|
2730
|
+
EnforcedStyle: require_no_parentheses
|
|
2731
|
+
SupportedStyles:
|
|
2732
|
+
- require_parentheses
|
|
2733
|
+
- require_no_parentheses
|
|
2734
|
+
- require_parentheses_when_complex
|
|
2735
|
+
AllowSafeAssignment: true
|
|
2736
|
+
|
|
2737
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletoplevelmethoddefinition
|
|
2738
|
+
Style/TopLevelMethodDefinition:
|
|
2739
|
+
Description: Looks for top-level method definitions.
|
|
2740
|
+
StyleGuide: "#top-level-methods"
|
|
2741
|
+
Enabled: true # was false
|
|
2742
|
+
VersionAdded: '1.15'
|
|
2743
|
+
|
|
2744
|
+
# Supports --autocorrect
|
|
2745
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingbodyonclass
|
|
2746
|
+
Style/TrailingBodyOnClass:
|
|
2747
|
+
Description: Class body goes below class statement.
|
|
2748
|
+
Enabled: true
|
|
2749
|
+
VersionAdded: '0.53'
|
|
2750
|
+
|
|
2751
|
+
# Supports --autocorrect
|
|
2752
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingbodyonmethoddefinition
|
|
2753
|
+
Style/TrailingBodyOnMethodDefinition:
|
|
2754
|
+
Description: Method body goes below definition.
|
|
2755
|
+
Enabled: true
|
|
2756
|
+
VersionAdded: '0.52'
|
|
2757
|
+
|
|
2758
|
+
# Supports --autocorrect
|
|
2759
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingbodyonmodule
|
|
2760
|
+
Style/TrailingBodyOnModule:
|
|
2761
|
+
Description: Module body goes below module statement.
|
|
2762
|
+
Enabled: true
|
|
2763
|
+
VersionAdded: '0.53'
|
|
2764
|
+
|
|
2765
|
+
# Supports --autocorrect
|
|
2766
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainarguments
|
|
2767
|
+
Style/TrailingCommaInArguments:
|
|
2768
|
+
Description: Checks for trailing comma in argument lists.
|
|
2769
|
+
StyleGuide: "#no-trailing-params-comma"
|
|
2770
|
+
Enabled: true
|
|
2771
|
+
VersionAdded: '0.36'
|
|
2772
|
+
EnforcedStyleForMultiline: no_comma
|
|
2773
|
+
SupportedStylesForMultiline:
|
|
2774
|
+
- comma
|
|
2775
|
+
- consistent_comma
|
|
2776
|
+
- diff_comma
|
|
2777
|
+
- no_comma
|
|
2778
|
+
|
|
2779
|
+
# Supports --autocorrect
|
|
2780
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainarrayliteral
|
|
2781
|
+
Style/TrailingCommaInArrayLiteral:
|
|
2782
|
+
Description: Checks for trailing comma in array literals.
|
|
2783
|
+
StyleGuide: "#no-trailing-array-commas"
|
|
2784
|
+
Enabled: true
|
|
2785
|
+
VersionAdded: '0.53'
|
|
2786
|
+
EnforcedStyleForMultiline: no_comma
|
|
2787
|
+
SupportedStylesForMultiline:
|
|
2788
|
+
- comma
|
|
2789
|
+
- consistent_comma
|
|
2790
|
+
- diff_comma
|
|
2791
|
+
- no_comma
|
|
2792
|
+
|
|
2793
|
+
# Supports --autocorrect
|
|
2794
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainblockargs
|
|
2795
|
+
Style/TrailingCommaInBlockArgs:
|
|
2796
|
+
Description: Checks for useless trailing commas in block arguments.
|
|
2797
|
+
Enabled: true # was false
|
|
2798
|
+
Safe: false
|
|
2799
|
+
VersionAdded: '0.81'
|
|
2800
|
+
|
|
2801
|
+
# Supports --autocorrect
|
|
2802
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainhashliteral
|
|
2803
|
+
Style/TrailingCommaInHashLiteral:
|
|
2804
|
+
Description: Checks for trailing comma in hash literals.
|
|
2805
|
+
Enabled: true
|
|
2806
|
+
EnforcedStyleForMultiline: no_comma
|
|
2807
|
+
SupportedStylesForMultiline:
|
|
2808
|
+
- comma
|
|
2809
|
+
- consistent_comma
|
|
2810
|
+
- diff_comma
|
|
2811
|
+
- no_comma
|
|
2812
|
+
VersionAdded: '0.53'
|
|
2813
|
+
|
|
2814
|
+
# Supports --autocorrect
|
|
2815
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingmethodendstatement
|
|
2816
|
+
Style/TrailingMethodEndStatement:
|
|
2817
|
+
Description: Checks for trailing end statement on line of method body.
|
|
2818
|
+
Enabled: true
|
|
2819
|
+
VersionAdded: '0.52'
|
|
2820
|
+
|
|
2821
|
+
# Supports --autocorrect
|
|
2822
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingunderscorevariable
|
|
2823
|
+
Style/TrailingUnderscoreVariable:
|
|
2824
|
+
Description: Checks for the usage of unneeded trailing underscores at the end of parallel
|
|
2825
|
+
variable assignment.
|
|
2826
|
+
AllowNamedUnderscoreVariables: true
|
|
2827
|
+
Enabled: true
|
|
2828
|
+
VersionAdded: '0.31'
|
|
2829
|
+
VersionChanged: '0.35'
|
|
2830
|
+
|
|
2831
|
+
# Supports --autocorrect
|
|
2832
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletrivialaccessors
|
|
2833
|
+
Style/TrivialAccessors:
|
|
2834
|
+
Description: Prefer attr_* methods to trivial readers/writers.
|
|
2835
|
+
StyleGuide: "#attr_family"
|
|
2836
|
+
Enabled: true
|
|
2837
|
+
VersionAdded: '0.9'
|
|
2838
|
+
VersionChanged: '1.15'
|
|
2839
|
+
ExactNameMatch: true
|
|
2840
|
+
AllowPredicates: true
|
|
2841
|
+
AllowDSLWriters: true
|
|
2842
|
+
IgnoreClassMethods: false
|
|
2843
|
+
AllowedMethods:
|
|
2844
|
+
- to_ary
|
|
2845
|
+
- to_a
|
|
2846
|
+
- to_c
|
|
2847
|
+
- to_enum
|
|
2848
|
+
- to_h
|
|
2849
|
+
- to_hash
|
|
2850
|
+
- to_i
|
|
2851
|
+
- to_int
|
|
2852
|
+
- to_io
|
|
2853
|
+
- to_open
|
|
2854
|
+
- to_path
|
|
2855
|
+
- to_proc
|
|
2856
|
+
- to_r
|
|
2857
|
+
- to_regexp
|
|
2858
|
+
- to_str
|
|
2859
|
+
- to_s
|
|
2860
|
+
- to_sym
|
|
2861
|
+
|
|
2862
|
+
# Supports --autocorrect
|
|
2863
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleunlesselse
|
|
2864
|
+
Style/UnlessElse:
|
|
2865
|
+
Description: Do not use unless with else. Rewrite these with the positive case first.
|
|
2866
|
+
StyleGuide: "#no-else-with-unless"
|
|
2867
|
+
Enabled: true
|
|
2868
|
+
VersionAdded: '0.9'
|
|
2869
|
+
|
|
2870
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleunlesslogicaloperators
|
|
2871
|
+
Style/UnlessLogicalOperators:
|
|
2872
|
+
Description: Checks for use of logical operators in an unless condition.
|
|
2873
|
+
Enabled: true # was false
|
|
2874
|
+
VersionAdded: '1.11'
|
|
2875
|
+
EnforcedStyle: forbid_mixed_logical_operators
|
|
2876
|
+
SupportedStyles:
|
|
2877
|
+
- forbid_mixed_logical_operators
|
|
2878
|
+
- forbid_logical_operators
|
|
2879
|
+
|
|
2880
|
+
# Supports --autocorrect
|
|
2881
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleunpackfirst
|
|
2882
|
+
Style/UnpackFirst:
|
|
2883
|
+
Description: Checks for accessing the first element of `String#unpack` instead of
|
|
2884
|
+
using `unpack1`.
|
|
2885
|
+
Enabled: true
|
|
2886
|
+
VersionAdded: '0.54'
|
|
2887
|
+
|
|
2888
|
+
# Supports --autocorrect
|
|
2889
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylevariableinterpolation
|
|
2890
|
+
Style/VariableInterpolation:
|
|
2891
|
+
Description: Don't interpolate global, instance and class variables directly in strings.
|
|
2892
|
+
StyleGuide: "#curlies-interpolate"
|
|
2893
|
+
Enabled: true
|
|
2894
|
+
VersionAdded: '0.9'
|
|
2895
|
+
VersionChanged: '0.20'
|
|
2896
|
+
|
|
2897
|
+
# Supports --autocorrect
|
|
2898
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylewhenthen
|
|
2899
|
+
Style/WhenThen:
|
|
2900
|
+
Description: Use when x then ... for one-line cases.
|
|
2901
|
+
StyleGuide: "#no-when-semicolons"
|
|
2902
|
+
Enabled: true
|
|
2903
|
+
VersionAdded: '0.9'
|
|
2904
|
+
|
|
2905
|
+
# Supports --autocorrect
|
|
2906
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylewhileuntildo
|
|
2907
|
+
Style/WhileUntilDo:
|
|
2908
|
+
Description: Checks for redundant do after while or until.
|
|
2909
|
+
StyleGuide: "#no-multiline-while-do"
|
|
2910
|
+
Enabled: true
|
|
2911
|
+
VersionAdded: '0.9'
|
|
2912
|
+
|
|
2913
|
+
# Supports --autocorrect
|
|
2914
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylewhileuntilmodifier
|
|
2915
|
+
Style/WhileUntilModifier:
|
|
2916
|
+
Description: Favor modifier while/until usage when you have a single-line body.
|
|
2917
|
+
StyleGuide: "#while-as-a-modifier"
|
|
2918
|
+
Enabled: true
|
|
2919
|
+
VersionAdded: '0.9'
|
|
2920
|
+
VersionChanged: '0.30'
|
|
2921
|
+
|
|
2922
|
+
# Supports --autocorrect
|
|
2923
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylewordarray
|
|
2924
|
+
Style/WordArray:
|
|
2925
|
+
Description: Use %w or %W for arrays of words.
|
|
2926
|
+
StyleGuide: "#percent-w"
|
|
2927
|
+
Enabled: true
|
|
2928
|
+
VersionAdded: '0.9'
|
|
2929
|
+
VersionChanged: '1.19'
|
|
2930
|
+
EnforcedStyle: percent
|
|
2931
|
+
SupportedStyles:
|
|
2932
|
+
- percent
|
|
2933
|
+
- brackets
|
|
2934
|
+
MinSize: 2
|
|
2935
|
+
WordRegex: !ruby/regexp /\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/
|
|
2936
|
+
|
|
2937
|
+
# Supports --autocorrect
|
|
2938
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleyamlfileread
|
|
2939
|
+
Style/YAMLFileRead:
|
|
2940
|
+
Description: Checks for the use of `YAML.load`, `YAML.safe_load`, and `YAML.parse`
|
|
2941
|
+
with `File.read` argument.
|
|
2942
|
+
Enabled: true # was pending
|
|
2943
|
+
VersionAdded: '1.53'
|
|
2944
|
+
|
|
2945
|
+
# Supports --autocorrect
|
|
2946
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleyodacondition
|
|
2947
|
+
Style/YodaCondition:
|
|
2948
|
+
Description: Forbid or enforce yoda conditions.
|
|
2949
|
+
References:
|
|
2950
|
+
- https://en.wikipedia.org/wiki/Yoda_conditions
|
|
2951
|
+
Enabled: true
|
|
2952
|
+
EnforcedStyle: forbid_for_all_comparison_operators
|
|
2953
|
+
SupportedStyles:
|
|
2954
|
+
- forbid_for_all_comparison_operators
|
|
2955
|
+
- forbid_for_equality_operators_only
|
|
2956
|
+
- require_for_all_comparison_operators
|
|
2957
|
+
- require_for_equality_operators_only
|
|
2958
|
+
Safe: false
|
|
2959
|
+
VersionAdded: '0.49'
|
|
2960
|
+
VersionChanged: '0.75'
|
|
2961
|
+
|
|
2962
|
+
# Supports --autocorrect
|
|
2963
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleyodaexpression
|
|
2964
|
+
Style/YodaExpression:
|
|
2965
|
+
Description: Forbid the use of yoda expressions.
|
|
2966
|
+
Enabled: true # was false
|
|
2967
|
+
Safe: false
|
|
2968
|
+
VersionAdded: '1.42'
|
|
2969
|
+
VersionChanged: '1.43'
|
|
2970
|
+
SupportedOperators:
|
|
2971
|
+
- "*"
|
|
2972
|
+
- "+"
|
|
2973
|
+
- "&"
|
|
2974
|
+
- "|"
|
|
2975
|
+
- "^"
|
|
2976
|
+
|
|
2977
|
+
# Supports --autocorrect
|
|
2978
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylezerolengthpredicate
|
|
2979
|
+
Style/ZeroLengthPredicate:
|
|
2980
|
+
Description: 'Use #empty? when testing for objects of length 0.'
|
|
2981
|
+
Enabled: true
|
|
2982
|
+
Safe: false
|
|
2983
|
+
VersionAdded: '0.37'
|
|
2984
|
+
VersionChanged: '0.39'
|
|
2985
|
+
|