strawberry_api 0.5.4 → 0.6.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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4022 -4
  3. data/doc/HTTParty/Response.html +1 -1
  4. data/doc/StrawberryAPI.html +2 -2
  5. data/doc/StrawberryAPI/AccessRight.html +1 -1
  6. data/doc/StrawberryAPI/ApiKey.html +1 -1
  7. data/doc/StrawberryAPI/ArchiveStrategy.html +1 -1
  8. data/doc/StrawberryAPI/ArchiveStrategyState.html +1 -1
  9. data/doc/StrawberryAPI/Asset.html +1 -1
  10. data/doc/StrawberryAPI/AssetCopyToStrategy.html +1 -1
  11. data/doc/StrawberryAPI/AssetFeedback.html +1 -1
  12. data/doc/StrawberryAPI/Client.html +2 -2
  13. data/doc/StrawberryAPI/Client/ApiKeys.html +1 -1
  14. data/doc/StrawberryAPI/Client/ArchiveStrategies.html +1 -1
  15. data/doc/StrawberryAPI/Client/AssetCopyToStrategies.html +1 -1
  16. data/doc/StrawberryAPI/Client/AssetFeedbacks.html +1 -1
  17. data/doc/StrawberryAPI/Client/Assets.html +1 -1
  18. data/doc/StrawberryAPI/Client/Collections.html +1 -1
  19. data/doc/StrawberryAPI/Client/CopyToFeedbacks.html +1 -1
  20. data/doc/StrawberryAPI/Client/CustomMetadata.html +1 -1
  21. data/doc/StrawberryAPI/Client/CustomMetadataFields.html +1 -1
  22. data/doc/StrawberryAPI/Client/CustomMetadataOptions.html +1 -1
  23. data/doc/StrawberryAPI/Client/CustomMetadataSets.html +1 -1
  24. data/doc/StrawberryAPI/Client/Edits.html +1 -1
  25. data/doc/StrawberryAPI/Client/Features.html +1 -1
  26. data/doc/StrawberryAPI/Client/Libraries.html +1 -1
  27. data/doc/StrawberryAPI/Client/Markers.html +1 -1
  28. data/doc/StrawberryAPI/Client/ProjectCopyToStrategies.html +1 -1
  29. data/doc/StrawberryAPI/Client/ProjectFeedbacks.html +1 -1
  30. data/doc/StrawberryAPI/Client/Projects.html +92 -9
  31. data/doc/StrawberryAPI/Client/Roles.html +1 -1
  32. data/doc/StrawberryAPI/Client/Schedules.html +1 -1
  33. data/doc/StrawberryAPI/Client/Searches.html +1 -1
  34. data/doc/StrawberryAPI/Client/Sessions.html +1 -1
  35. data/doc/StrawberryAPI/Client/Settings.html +1 -1
  36. data/doc/StrawberryAPI/Client/StatusFlags.html +1 -1
  37. data/doc/StrawberryAPI/Client/Teams.html +1 -1
  38. data/doc/StrawberryAPI/Client/Templates.html +1 -1
  39. data/doc/StrawberryAPI/Client/Users.html +1 -1
  40. data/doc/StrawberryAPI/Collection.html +1 -1
  41. data/doc/StrawberryAPI/Configuration.html +1 -1
  42. data/doc/StrawberryAPI/CopyToFeedback.html +1 -1
  43. data/doc/StrawberryAPI/CustomMetadataField.html +1 -1
  44. data/doc/StrawberryAPI/CustomMetadataOption.html +1 -1
  45. data/doc/StrawberryAPI/CustomMetadataSet.html +1 -1
  46. data/doc/StrawberryAPI/CustomMetadatum.html +1 -1
  47. data/doc/StrawberryAPI/Edit.html +1 -1
  48. data/doc/StrawberryAPI/Feature.html +1 -1
  49. data/doc/StrawberryAPI/Feedback.html +1 -1
  50. data/doc/StrawberryAPI/HttpClient.html +1 -1
  51. data/doc/StrawberryAPI/Library.html +1 -1
  52. data/doc/StrawberryAPI/Marker.html +1 -1
  53. data/doc/StrawberryAPI/Metadatum.html +1 -1
  54. data/doc/StrawberryAPI/Project.html +1 -1
  55. data/doc/StrawberryAPI/ProjectCopyToStrategy.html +1 -1
  56. data/doc/StrawberryAPI/ProjectFeedback.html +1 -1
  57. data/doc/StrawberryAPI/Proxy.html +1 -1
  58. data/doc/StrawberryAPI/Role.html +1 -1
  59. data/doc/StrawberryAPI/Schedule.html +1 -1
  60. data/doc/StrawberryAPI/Session.html +1 -1
  61. data/doc/StrawberryAPI/Setting.html +1 -1
  62. data/doc/StrawberryAPI/StatusFlag.html +1 -1
  63. data/doc/StrawberryAPI/Strategy.html +1 -1
  64. data/doc/StrawberryAPI/Team.html +1 -1
  65. data/doc/StrawberryAPI/Template.html +1 -1
  66. data/doc/StrawberryAPI/User.html +1 -1
  67. data/doc/_index.html +1 -1
  68. data/doc/file.README.html +87 -103
  69. data/doc/index.html +87 -103
  70. data/doc/method_list.html +343 -335
  71. data/doc/top-level-namespace.html +1 -1
  72. data/lib/strawberry_api.rb +4 -4
  73. data/lib/strawberry_api/client.rb +61 -61
  74. data/lib/strawberry_api/client/projects.rb +36 -36
  75. data/lib/strawberry_api/http_client.rb +11 -11
  76. data/lib/strawberry_api/version.rb +1 -1
  77. data/samples/test.rb +1 -1
  78. data/strawberry_api.gemspec +21 -22
  79. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0eb2c1af77240930135a26a9ce202ec489df7e24713957bb36c34398fb596623
4
- data.tar.gz: 363ec3a962edce3dcc5fb8a36efab98eff040fe2dd4e7a2ed7011173b1789f6d
3
+ metadata.gz: 4fa922fc310a9ddfb243904cd04dab217c76b3e4525cd82a28776d1296de4465
4
+ data.tar.gz: 304453e3039c4a8a6ec4e3cc7bd5b7077685dfffa47525edf52262dd394f2647
5
5
  SHA512:
6
- metadata.gz: f3eead84e5cb8c79e861cff13675abb4c5f2b756c4664fe5c0b37af62f39e625f30ef956866272b921f9fae8c66127b79a2bcd0c4a289ee46a200ef39a0adb63
7
- data.tar.gz: 70a7dd69bd2c0964ab478dcf87d06292ede007aa3b57af34e9f651c0d8a2e19c4b67fedf94a551e80ce013e298935ef424057a9a7e5f803bde30b960e50760f0
6
+ metadata.gz: 2e93404dc1a0a5c37c498d8d9b0d6ce4e8f7e9f505d1c04c74dfbbf7f04930d24c931b6ade05c7b3263781158e98dbdefffdd7e10d46d1d29208b9189af9950b
7
+ data.tar.gz: dccbc79ebc91745ec88069a244d49644bd023d9db1d9157ca307b734758fc583a38bc8b115c0a38cc79c6c10859ae4e6640d9e67e9b8b926bd0cbaecf31e8461
data/.rubocop.yml CHANGED
@@ -1,4 +1,4022 @@
1
- {
2
- AllCops:
3
- TargetRubyVersion: 2.5
4
- }
1
+ # Common configuration.
2
+
3
+ AllCops:
4
+ RubyInterpreters:
5
+ - ruby
6
+ - macruby
7
+ - rake
8
+ - jruby
9
+ - rbx
10
+ # Include common Ruby source files.
11
+ Include:
12
+ - '**/*.rb'
13
+ - '**/*.arb'
14
+ - '**/*.axlsx'
15
+ - '**/*.builder'
16
+ - '**/*.fcgi'
17
+ - '**/*.gemfile'
18
+ - '**/*.gemspec'
19
+ - '**/*.god'
20
+ - '**/*.jb'
21
+ - '**/*.jbuilder'
22
+ - '**/*.mspec'
23
+ - '**/*.opal'
24
+ - '**/*.pluginspec'
25
+ - '**/*.podspec'
26
+ - '**/*.rabl'
27
+ - '**/*.rake'
28
+ - '**/*.rbuild'
29
+ - '**/*.rbw'
30
+ - '**/*.rbx'
31
+ - '**/*.ru'
32
+ - '**/*.ruby'
33
+ - '**/*.spec'
34
+ - '**/*.thor'
35
+ - '**/*.watchr'
36
+ - '**/.irbrc'
37
+ - '**/.pryrc'
38
+ - '**/buildfile'
39
+ - '**/Appraisals'
40
+ - '**/Berksfile'
41
+ - '**/Brewfile'
42
+ - '**/Buildfile'
43
+ - '**/Capfile'
44
+ - '**/Cheffile'
45
+ - '**/Dangerfile'
46
+ - '**/Deliverfile'
47
+ - '**/Fastfile'
48
+ - '**/*Fastfile'
49
+ - '**/Gemfile'
50
+ - '**/Guardfile'
51
+ - '**/Jarfile'
52
+ - '**/Mavenfile'
53
+ - '**/Podfile'
54
+ - '**/Puppetfile'
55
+ - '**/Rakefile'
56
+ - '**/Snapfile'
57
+ - '**/Steepfile'
58
+ - '**/Thorfile'
59
+ - '**/Vagabondfile'
60
+ - '**/Vagrantfile'
61
+ Exclude:
62
+ - 'node_modules/**/*'
63
+ - 'tmp/**/*'
64
+ - 'vendor/**/*'
65
+ - '.git/**/*'
66
+ # Default formatter will be used if no `-f/--format` option is given.
67
+ DefaultFormatter: progress
68
+ # Cop names are displayed in offense messages by default. Change behavior
69
+ # by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
70
+ # option.
71
+ DisplayCopNames: true
72
+ # Style guide URLs are not displayed in offense messages by default. Change
73
+ # behavior by overriding `DisplayStyleGuide`, or by giving the
74
+ # `-S/--display-style-guide` option.
75
+ DisplayStyleGuide: false
76
+ # When specifying style guide URLs, any paths and/or fragments will be
77
+ # evaluated relative to the base URL.
78
+ StyleGuideBaseURL: https://rubystyle.guide
79
+ # Extra details are not displayed in offense messages by default. Change
80
+ # behavior by overriding ExtraDetails, or by giving the
81
+ # `-E/--extra-details` option.
82
+ ExtraDetails: false
83
+ # Additional cops that do not reference a style guide rule may be enabled by
84
+ # default. Change behavior by overriding `StyleGuideCopsOnly`, or by giving
85
+ # the `--only-guide-cops` option.
86
+ StyleGuideCopsOnly: false
87
+ # All cops except the ones configured `Enabled: false` in this file are enabled by default.
88
+ # Change this behavior by overriding either `DisabledByDefault` or `EnabledByDefault`.
89
+ # When `DisabledByDefault` is `true`, all cops in the default configuration
90
+ # are disabled, and only cops in user configuration are enabled. This makes
91
+ # cops opt-in instead of opt-out. Note that when `DisabledByDefault` is `true`,
92
+ # cops in user configuration will be enabled even if they don't set the
93
+ # Enabled parameter.
94
+ # When `EnabledByDefault` is `true`, all cops, even those configured `Enabled: false`
95
+ # in this file are enabled by default. Cops can still be disabled in user configuration.
96
+ # Note that it is invalid to set both EnabledByDefault and DisabledByDefault
97
+ # to true in the same configuration.
98
+ EnabledByDefault: false
99
+ DisabledByDefault: false
100
+ # Enables the result cache if `true`. Can be overridden by the `--cache` command
101
+ # line option.
102
+ UseCache: true
103
+ # Threshold for how many files can be stored in the result cache before some
104
+ # of the files are automatically removed.
105
+ MaxFilesInCache: 20000
106
+ # The cache will be stored in "rubocop_cache" under this directory. If
107
+ # CacheRootDirectory is ~ (nil), which it is by default, the root will be
108
+ # taken from the environment variable `$XDG_CACHE_HOME` if it is set, or if
109
+ # `$XDG_CACHE_HOME` is not set, it will be `$HOME/.cache/`.
110
+ CacheRootDirectory: ~
111
+ # It is possible for a malicious user to know the location of RuboCop's cache
112
+ # directory by looking at CacheRootDirectory, and create a symlink in its
113
+ # place that could cause RuboCop to overwrite unintended files, or read
114
+ # malicious input. If you are certain that your cache location is secure from
115
+ # this kind of attack, and wish to use a symlinked cache location, set this
116
+ # value to "true".
117
+ AllowSymlinksInCacheRootDirectory: false
118
+ # What MRI version of the Ruby interpreter is the inspected code intended to
119
+ # run on? (If there is more than one, set this to the lowest version.)
120
+ # If a value is specified for TargetRubyVersion then it is used. Acceptable
121
+ # values are specificed as a float (i.e. 2.5); the teeny version of Ruby
122
+ # should not be included. If the project specifies a Ruby version in the
123
+ # .ruby-version file, Gemfile or gems.rb file, RuboCop will try to determine
124
+ # the desired version of Ruby by inspecting the .ruby-version file first,
125
+ # followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
126
+ # is specified in the Gemfile or gems.rb file, RuboCop reads the final value
127
+ # from the lock file.) If the Ruby version is still unresolved, RuboCop will
128
+ # use the oldest officially supported Ruby version (currently Ruby 2.3).
129
+ TargetRubyVersion: ~
130
+
131
+ #################### Bundler ###############################
132
+
133
+ Bundler/DuplicatedGem:
134
+ Description: 'Checks for duplicate gem entries in Gemfile.'
135
+ Enabled: true
136
+ VersionAdded: '0.46'
137
+ Include:
138
+ - '**/*.gemfile'
139
+ - '**/Gemfile'
140
+ - '**/gems.rb'
141
+
142
+ Bundler/GemComment:
143
+ Description: 'Add a comment describing each gem.'
144
+ Enabled: false
145
+ VersionAdded: '0.59'
146
+ VersionChanged: '0.77'
147
+ Include:
148
+ - '**/*.gemfile'
149
+ - '**/Gemfile'
150
+ - '**/gems.rb'
151
+ IgnoredGems: []
152
+
153
+ Bundler/InsecureProtocolSource:
154
+ Description: >-
155
+ The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
156
+ because HTTP requests are insecure. Please change your source to
157
+ 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
158
+ Enabled: true
159
+ VersionAdded: '0.50'
160
+ Include:
161
+ - '**/*.gemfile'
162
+ - '**/Gemfile'
163
+ - '**/gems.rb'
164
+
165
+ Bundler/OrderedGems:
166
+ Description: >-
167
+ Gems within groups in the Gemfile should be alphabetically sorted.
168
+ Enabled: true
169
+ VersionAdded: '0.46'
170
+ VersionChanged: '0.47'
171
+ TreatCommentsAsGroupSeparators: true
172
+ Include:
173
+ - '**/*.gemfile'
174
+ - '**/Gemfile'
175
+ - '**/gems.rb'
176
+
177
+ #################### Gemspec ###############################
178
+
179
+ Gemspec/DuplicatedAssignment:
180
+ Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
181
+ Enabled: true
182
+ VersionAdded: '0.52'
183
+ Include:
184
+ - '**/*.gemspec'
185
+
186
+ Gemspec/OrderedDependencies:
187
+ Description: >-
188
+ Dependencies in the gemspec should be alphabetically sorted.
189
+ Enabled: true
190
+ VersionAdded: '0.51'
191
+ TreatCommentsAsGroupSeparators: true
192
+ Include:
193
+ - '**/*.gemspec'
194
+
195
+ Gemspec/RequiredRubyVersion:
196
+ Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
197
+ Enabled: true
198
+ VersionAdded: '0.52'
199
+ Include:
200
+ - '**/*.gemspec'
201
+
202
+ Gemspec/RubyVersionGlobalsUsage:
203
+ Description: Checks usage of RUBY_VERSION in gemspec.
204
+ StyleGuide: '#no-ruby-version-in-the-gemspec'
205
+ Enabled: true
206
+ VersionAdded: '0.72'
207
+ Include:
208
+ - '**/*.gemspec'
209
+
210
+ #################### Layout ###########################
211
+
212
+ Layout/AccessModifierIndentation:
213
+ Description: Check indentation of private/protected visibility modifiers.
214
+ StyleGuide: '#indent-public-private-protected'
215
+ Enabled: true
216
+ VersionAdded: '0.49'
217
+ EnforcedStyle: indent
218
+ SupportedStyles:
219
+ - outdent
220
+ - indent
221
+ # By default, the indentation width from Layout/IndentationWidth is used
222
+ # But it can be overridden by setting this parameter
223
+ IndentationWidth: ~
224
+
225
+ Layout/ArgumentAlignment:
226
+ Description: >-
227
+ Align the arguments of a method call if they span more
228
+ than one line.
229
+ StyleGuide: '#no-double-indent'
230
+ Enabled: true
231
+ VersionAdded: '0.68'
232
+ VersionChanged: '0.77'
233
+ # Alignment of arguments in multi-line method calls.
234
+ #
235
+ # The `with_first_argument` style aligns the following lines along the same
236
+ # column as the first parameter.
237
+ #
238
+ # method_call(a,
239
+ # b)
240
+ #
241
+ # The `with_fixed_indentation` style aligns the following lines with one
242
+ # level of indentation relative to the start of the line with the method call.
243
+ #
244
+ # method_call(a,
245
+ # b)
246
+ EnforcedStyle: with_first_argument
247
+ SupportedStyles:
248
+ - with_first_argument
249
+ - with_fixed_indentation
250
+ # By default, the indentation width from Layout/IndentationWidth is used
251
+ # But it can be overridden by setting this parameter
252
+ IndentationWidth: ~
253
+
254
+ Layout/ArrayAlignment:
255
+ Description: >-
256
+ Align the elements of an array literal if they span more than
257
+ one line.
258
+ StyleGuide: '#no-double-indent'
259
+ Enabled: true
260
+ VersionAdded: '0.49'
261
+ VersionChanged: '0.77'
262
+ # Alignment of elements of a multi-line array.
263
+ #
264
+ # The `with_first_parameter` style aligns the following lines along the same
265
+ # column as the first element.
266
+ #
267
+ # array = [1, 2, 3,
268
+ # 4, 5, 6]
269
+ #
270
+ # The `with_fixed_indentation` style aligns the following lines with one
271
+ # level of indentation relative to the start of the line with start of array.
272
+ #
273
+ # array = [1, 2, 3,
274
+ # 4, 5, 6]
275
+ EnforcedStyle: with_first_element
276
+ SupportedStyles:
277
+ - with_first_element
278
+ - with_fixed_indentation
279
+ # By default, the indentation width from Layout/IndentationWidth is used
280
+ # But it can be overridden by setting this parameter
281
+ IndentationWidth: ~
282
+
283
+ Layout/AssignmentIndentation:
284
+ Description: >-
285
+ Checks the indentation of the first line of the
286
+ right-hand-side of a multi-line assignment.
287
+ Enabled: true
288
+ VersionAdded: '0.49'
289
+ VersionChanged: '0.77'
290
+ # By default, the indentation width from `Layout/IndentationWidth` is used
291
+ # But it can be overridden by setting this parameter
292
+ IndentationWidth: ~
293
+
294
+ Layout/BlockAlignment:
295
+ Description: 'Align block ends correctly.'
296
+ Enabled: true
297
+ VersionAdded: '0.53'
298
+ # The value `start_of_block` means that the `end` should be aligned with line
299
+ # where the `do` keyword appears.
300
+ # The value `start_of_line` means it should be aligned with the whole
301
+ # expression's starting line.
302
+ # The value `either` means both are allowed.
303
+ EnforcedStyleAlignWith: either
304
+ SupportedStylesAlignWith:
305
+ - either
306
+ - start_of_block
307
+ - start_of_line
308
+
309
+ Layout/BlockEndNewline:
310
+ Description: 'Put end statement of multiline block on its own line.'
311
+ Enabled: true
312
+ VersionAdded: '0.49'
313
+
314
+ Layout/CaseIndentation:
315
+ Description: 'Indentation of when in a case/when/[else/]end.'
316
+ StyleGuide: '#indent-when-to-case'
317
+ Enabled: true
318
+ VersionAdded: '0.49'
319
+ EnforcedStyle: case
320
+ SupportedStyles:
321
+ - case
322
+ - end
323
+ IndentOneStep: false
324
+ # By default, the indentation width from `Layout/IndentationWidth` is used.
325
+ # But it can be overridden by setting this parameter.
326
+ # This only matters if `IndentOneStep` is `true`
327
+ IndentationWidth: ~
328
+
329
+ Layout/ClassStructure:
330
+ Description: 'Enforces a configured order of definitions within a class body.'
331
+ StyleGuide: '#consistent-classes'
332
+ Enabled: false
333
+ VersionAdded: '0.52'
334
+ Categories:
335
+ module_inclusion:
336
+ - include
337
+ - prepend
338
+ - extend
339
+ ExpectedOrder:
340
+ - module_inclusion
341
+ - constants
342
+ - public_class_methods
343
+ - initializer
344
+ - public_methods
345
+ - protected_methods
346
+ - private_methods
347
+
348
+ Layout/ClosingHeredocIndentation:
349
+ Description: 'Checks the indentation of here document closings.'
350
+ Enabled: true
351
+ VersionAdded: '0.57'
352
+
353
+ Layout/ClosingParenthesisIndentation:
354
+ Description: 'Checks the indentation of hanging closing parentheses.'
355
+ Enabled: true
356
+ VersionAdded: '0.49'
357
+
358
+ Layout/CommentIndentation:
359
+ Description: 'Indentation of comments.'
360
+ Enabled: true
361
+ VersionAdded: '0.49'
362
+
363
+ Layout/ConditionPosition:
364
+ Description: >-
365
+ Checks for condition placed in a confusing position relative to
366
+ the keyword.
367
+ StyleGuide: '#same-line-condition'
368
+ Enabled: true
369
+ VersionAdded: '0.53'
370
+
371
+ Layout/DefEndAlignment:
372
+ Description: 'Align ends corresponding to defs correctly.'
373
+ Enabled: true
374
+ VersionAdded: '0.53'
375
+ # The value `def` means that `end` should be aligned with the def keyword.
376
+ # The value `start_of_line` means that `end` should be aligned with method
377
+ # calls like `private`, `public`, etc, if present in front of the `def`
378
+ # keyword on the same line.
379
+ EnforcedStyleAlignWith: start_of_line
380
+ SupportedStylesAlignWith:
381
+ - start_of_line
382
+ - def
383
+ AutoCorrect: false
384
+ Severity: warning
385
+
386
+ Layout/DotPosition:
387
+ Description: 'Checks the position of the dot in multi-line method calls.'
388
+ StyleGuide: '#consistent-multi-line-chains'
389
+ Enabled: true
390
+ VersionAdded: '0.49'
391
+ EnforcedStyle: leading
392
+ SupportedStyles:
393
+ - leading
394
+ - trailing
395
+
396
+ Layout/ElseAlignment:
397
+ Description: 'Align elses and elsifs correctly.'
398
+ Enabled: true
399
+ VersionAdded: '0.49'
400
+
401
+ Layout/EmptyComment:
402
+ Description: 'Checks empty comment.'
403
+ Enabled: true
404
+ VersionAdded: '0.53'
405
+ AllowBorderComment: true
406
+ AllowMarginComment: true
407
+
408
+ Layout/EmptyLineAfterGuardClause:
409
+ Description: 'Add empty line after guard clause.'
410
+ Enabled: true
411
+ VersionAdded: '0.56'
412
+ VersionChanged: '0.59'
413
+
414
+ Layout/EmptyLineAfterMagicComment:
415
+ Description: 'Add an empty line after magic comments to separate them from code.'
416
+ StyleGuide: '#separate-magic-comments-from-code'
417
+ Enabled: true
418
+ VersionAdded: '0.49'
419
+
420
+ Layout/EmptyLineBetweenDefs:
421
+ Description: 'Use empty lines between defs.'
422
+ StyleGuide: '#empty-lines-between-methods'
423
+ Enabled: true
424
+ VersionAdded: '0.49'
425
+ # If `true`, this parameter means that single line method definitions don't
426
+ # need an empty line between them.
427
+ AllowAdjacentOneLineDefs: false
428
+ # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
429
+ NumberOfEmptyLines: 1
430
+
431
+ Layout/EmptyLines:
432
+ Description: "Don't use several empty lines in a row."
433
+ StyleGuide: '#two-or-more-empty-lines'
434
+ Enabled: true
435
+ VersionAdded: '0.49'
436
+
437
+ Layout/EmptyLinesAroundAccessModifier:
438
+ Description: "Keep blank lines around access modifiers."
439
+ StyleGuide: '#empty-lines-around-access-modifier'
440
+ Enabled: true
441
+ VersionAdded: '0.49'
442
+ EnforcedStyle: around
443
+ SupportedStyles:
444
+ - around
445
+ - only_before
446
+ Reference:
447
+ # A reference to `EnforcedStyle: only_before`.
448
+ - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
449
+
450
+ Layout/EmptyLinesAroundArguments:
451
+ Description: "Keeps track of empty lines around method arguments."
452
+ Enabled: true
453
+ VersionAdded: '0.52'
454
+
455
+ Layout/EmptyLinesAroundBeginBody:
456
+ Description: "Keeps track of empty lines around begin-end bodies."
457
+ StyleGuide: '#empty-lines-around-bodies'
458
+ Enabled: true
459
+ VersionAdded: '0.49'
460
+
461
+ Layout/EmptyLinesAroundBlockBody:
462
+ Description: "Keeps track of empty lines around block bodies."
463
+ StyleGuide: '#empty-lines-around-bodies'
464
+ Enabled: true
465
+ VersionAdded: '0.49'
466
+ EnforcedStyle: no_empty_lines
467
+ SupportedStyles:
468
+ - empty_lines
469
+ - no_empty_lines
470
+
471
+ Layout/EmptyLinesAroundClassBody:
472
+ Description: "Keeps track of empty lines around class bodies."
473
+ StyleGuide: '#empty-lines-around-bodies'
474
+ Enabled: true
475
+ VersionAdded: '0.49'
476
+ VersionChanged: '0.53'
477
+ EnforcedStyle: no_empty_lines
478
+ SupportedStyles:
479
+ - empty_lines
480
+ - empty_lines_except_namespace
481
+ - empty_lines_special
482
+ - no_empty_lines
483
+ - beginning_only
484
+ - ending_only
485
+
486
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
487
+ Description: "Keeps track of empty lines around exception handling keywords."
488
+ StyleGuide: '#empty-lines-around-bodies'
489
+ Enabled: true
490
+ VersionAdded: '0.49'
491
+
492
+ Layout/EmptyLinesAroundMethodBody:
493
+ Description: "Keeps track of empty lines around method bodies."
494
+ StyleGuide: '#empty-lines-around-bodies'
495
+ Enabled: true
496
+ VersionAdded: '0.49'
497
+
498
+ Layout/EmptyLinesAroundModuleBody:
499
+ Description: "Keeps track of empty lines around module bodies."
500
+ StyleGuide: '#empty-lines-around-bodies'
501
+ Enabled: true
502
+ VersionAdded: '0.49'
503
+ EnforcedStyle: no_empty_lines
504
+ SupportedStyles:
505
+ - empty_lines
506
+ - empty_lines_except_namespace
507
+ - empty_lines_special
508
+ - no_empty_lines
509
+
510
+ Layout/EndAlignment:
511
+ Description: 'Align ends correctly.'
512
+ Enabled: true
513
+ VersionAdded: '0.53'
514
+ # The value `keyword` means that `end` should be aligned with the matching
515
+ # keyword (`if`, `while`, etc.).
516
+ # The value `variable` means that in assignments, `end` should be aligned
517
+ # with the start of the variable on the left hand side of `=`. In all other
518
+ # situations, `end` should still be aligned with the keyword.
519
+ # The value `start_of_line` means that `end` should be aligned with the start
520
+ # of the line which the matching keyword appears on.
521
+ EnforcedStyleAlignWith: keyword
522
+ SupportedStylesAlignWith:
523
+ - keyword
524
+ - variable
525
+ - start_of_line
526
+ AutoCorrect: false
527
+ Severity: warning
528
+
529
+ Layout/EndOfLine:
530
+ Description: 'Use Unix-style line endings.'
531
+ StyleGuide: '#crlf'
532
+ Enabled: true
533
+ VersionAdded: '0.49'
534
+ # The `native` style means that CR+LF (Carriage Return + Line Feed) is
535
+ # enforced on Windows, and LF is enforced on other platforms. The other styles
536
+ # mean LF and CR+LF, respectively.
537
+ EnforcedStyle: native
538
+ SupportedStyles:
539
+ - native
540
+ - lf
541
+ - crlf
542
+
543
+ Layout/ExtraSpacing:
544
+ Description: 'Do not use unnecessary spacing.'
545
+ Enabled: true
546
+ VersionAdded: '0.49'
547
+ # When true, allows most uses of extra spacing if the intent is to align
548
+ # things with the previous or next line, not counting empty lines or comment
549
+ # lines.
550
+ AllowForAlignment: true
551
+ # When true, allows things like 'obj.meth(arg) # comment',
552
+ # rather than insisting on 'obj.meth(arg) # comment'.
553
+ # If done for alignment, either this OR AllowForAlignment will allow it.
554
+ AllowBeforeTrailingComments: false
555
+ # When true, forces the alignment of `=` in assignments on consecutive lines.
556
+ ForceEqualSignAlignment: false
557
+
558
+ Layout/FirstArgumentIndentation:
559
+ Description: 'Checks the indentation of the first argument in a method call.'
560
+ Enabled: true
561
+ VersionAdded: '0.68'
562
+ VersionChanged: '0.77'
563
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
564
+ SupportedStyles:
565
+ # The first parameter should always be indented one step more than the
566
+ # preceding line.
567
+ - consistent
568
+ # The first parameter should always be indented one level relative to the
569
+ # parent that is receiving the parameter
570
+ - consistent_relative_to_receiver
571
+ # The first parameter should normally be indented one step more than the
572
+ # preceding line, but if it's a parameter for a method call that is itself
573
+ # a parameter in a method call, then the inner parameter should be indented
574
+ # relative to the inner method.
575
+ - special_for_inner_method_call
576
+ # Same as `special_for_inner_method_call` except that the special rule only
577
+ # applies if the outer method call encloses its arguments in parentheses.
578
+ - special_for_inner_method_call_in_parentheses
579
+ # By default, the indentation width from `Layout/IndentationWidth` is used
580
+ # But it can be overridden by setting this parameter
581
+ IndentationWidth: ~
582
+
583
+ Layout/FirstArrayElementIndentation:
584
+ Description: >-
585
+ Checks the indentation of the first element in an array
586
+ literal.
587
+ Enabled: true
588
+ VersionAdded: '0.68'
589
+ VersionChanged: '0.77'
590
+ # The value `special_inside_parentheses` means that array literals with
591
+ # brackets that have their opening bracket on the same line as a surrounding
592
+ # opening round parenthesis, shall have their first element indented relative
593
+ # to the first position inside the parenthesis.
594
+ #
595
+ # The value `consistent` means that the indentation of the first element shall
596
+ # always be relative to the first position of the line where the opening
597
+ # bracket is.
598
+ #
599
+ # The value `align_brackets` means that the indentation of the first element
600
+ # shall always be relative to the position of the opening bracket.
601
+ EnforcedStyle: special_inside_parentheses
602
+ SupportedStyles:
603
+ - special_inside_parentheses
604
+ - consistent
605
+ - align_brackets
606
+ # By default, the indentation width from `Layout/IndentationWidth` is used
607
+ # But it can be overridden by setting this parameter
608
+ IndentationWidth: ~
609
+
610
+ Layout/FirstArrayElementLineBreak:
611
+ Description: >-
612
+ Checks for a line break before the first element in a
613
+ multi-line array.
614
+ Enabled: false
615
+ VersionAdded: '0.49'
616
+
617
+ Layout/FirstHashElementIndentation:
618
+ Description: 'Checks the indentation of the first key in a hash literal.'
619
+ Enabled: true
620
+ VersionAdded: '0.68'
621
+ VersionChanged: '0.77'
622
+ # The value `special_inside_parentheses` means that hash literals with braces
623
+ # that have their opening brace on the same line as a surrounding opening
624
+ # round parenthesis, shall have their first key indented relative to the
625
+ # first position inside the parenthesis.
626
+ #
627
+ # The value `consistent` means that the indentation of the first key shall
628
+ # always be relative to the first position of the line where the opening
629
+ # brace is.
630
+ #
631
+ # The value `align_braces` means that the indentation of the first key shall
632
+ # always be relative to the position of the opening brace.
633
+ EnforcedStyle: special_inside_parentheses
634
+ SupportedStyles:
635
+ - special_inside_parentheses
636
+ - consistent
637
+ - align_braces
638
+ # By default, the indentation width from `Layout/IndentationWidth` is used
639
+ # But it can be overridden by setting this parameter
640
+ IndentationWidth: ~
641
+
642
+ Layout/FirstHashElementLineBreak:
643
+ Description: >-
644
+ Checks for a line break before the first element in a
645
+ multi-line hash.
646
+ Enabled: false
647
+ VersionAdded: '0.49'
648
+
649
+ Layout/FirstMethodArgumentLineBreak:
650
+ Description: >-
651
+ Checks for a line break before the first argument in a
652
+ multi-line method call.
653
+ Enabled: false
654
+ VersionAdded: '0.49'
655
+
656
+ Layout/FirstMethodParameterLineBreak:
657
+ Description: >-
658
+ Checks for a line break before the first parameter in a
659
+ multi-line method parameter definition.
660
+ Enabled: false
661
+ VersionAdded: '0.49'
662
+
663
+ Layout/FirstParameterIndentation:
664
+ Description: >-
665
+ Checks the indentation of the first parameter in a
666
+ method definition.
667
+ Enabled: true
668
+ VersionAdded: '0.49'
669
+ VersionChanged: '0.77'
670
+ EnforcedStyle: consistent
671
+ SupportedStyles:
672
+ - consistent
673
+ - align_parentheses
674
+ # By default, the indentation width from `Layout/IndentationWidth` is used
675
+ # But it can be overridden by setting this parameter
676
+ IndentationWidth: ~
677
+
678
+ Layout/HashAlignment:
679
+ Description: >-
680
+ Align the elements of a hash literal if they span more than
681
+ one line.
682
+ Enabled: true
683
+ AllowMultipleStyles: true
684
+ VersionAdded: '0.49'
685
+ VersionChanged: '0.77'
686
+ # Alignment of entries using hash rocket as separator. Valid values are:
687
+ #
688
+ # key - left alignment of keys
689
+ # 'a' => 2
690
+ # 'bb' => 3
691
+ # separator - alignment of hash rockets, keys are right aligned
692
+ # 'a' => 2
693
+ # 'bb' => 3
694
+ # table - left alignment of keys, hash rockets, and values
695
+ # 'a' => 2
696
+ # 'bb' => 3
697
+ EnforcedHashRocketStyle: key
698
+ SupportedHashRocketStyles:
699
+ - key
700
+ - separator
701
+ - table
702
+ # Alignment of entries using colon as separator. Valid values are:
703
+ #
704
+ # key - left alignment of keys
705
+ # a: 0
706
+ # bb: 1
707
+ # separator - alignment of colons, keys are right aligned
708
+ # a: 0
709
+ # bb: 1
710
+ # table - left alignment of keys and values
711
+ # a: 0
712
+ # bb: 1
713
+ EnforcedColonStyle: key
714
+ SupportedColonStyles:
715
+ - key
716
+ - separator
717
+ - table
718
+ # Select whether hashes that are the last argument in a method call should be
719
+ # inspected? Valid values are:
720
+ #
721
+ # always_inspect - Inspect both implicit and explicit hashes.
722
+ # Registers an offense for:
723
+ # function(a: 1,
724
+ # b: 2)
725
+ # Registers an offense for:
726
+ # function({a: 1,
727
+ # b: 2})
728
+ # always_ignore - Ignore both implicit and explicit hashes.
729
+ # Accepts:
730
+ # function(a: 1,
731
+ # b: 2)
732
+ # Accepts:
733
+ # function({a: 1,
734
+ # b: 2})
735
+ # ignore_implicit - Ignore only implicit hashes.
736
+ # Accepts:
737
+ # function(a: 1,
738
+ # b: 2)
739
+ # Registers an offense for:
740
+ # function({a: 1,
741
+ # b: 2})
742
+ # ignore_explicit - Ignore only explicit hashes.
743
+ # Accepts:
744
+ # function({a: 1,
745
+ # b: 2})
746
+ # Registers an offense for:
747
+ # function(a: 1,
748
+ # b: 2)
749
+ EnforcedLastArgumentHashStyle: always_inspect
750
+ SupportedLastArgumentHashStyles:
751
+ - always_inspect
752
+ - always_ignore
753
+ - ignore_implicit
754
+ - ignore_explicit
755
+
756
+ Layout/HeredocArgumentClosingParenthesis:
757
+ Description: >-
758
+ Checks for the placement of the closing parenthesis in a
759
+ method call that passes a HEREDOC string as an argument.
760
+ Enabled: false
761
+ StyleGuide: '#heredoc-argument-closing-parentheses'
762
+ VersionAdded: '0.68'
763
+
764
+ Layout/HeredocIndentation:
765
+ Description: 'This cop checks the indentation of the here document bodies.'
766
+ StyleGuide: '#squiggly-heredocs'
767
+ Enabled: true
768
+ VersionAdded: '0.49'
769
+ VersionChanged: '0.77'
770
+ EnforcedStyle: squiggly
771
+ SupportedStyles:
772
+ - squiggly
773
+ - active_support
774
+ - powerpack
775
+ - unindent
776
+
777
+ Layout/IndentationConsistency:
778
+ Description: 'Keep indentation straight.'
779
+ StyleGuide: '#spaces-indentation'
780
+ Enabled: true
781
+ VersionAdded: '0.49'
782
+ # The difference between `indented` and `normal` is that the `indented_internal_methods`
783
+ # style prescribes that in classes and modules the `protected` and `private`
784
+ # modifier keywords shall be indented the same as public methods and that
785
+ # protected and private members shall be indented one step more than the
786
+ # modifiers. Other than that, both styles mean that entities on the same
787
+ # logical depth shall have the same indentation.
788
+ EnforcedStyle: normal
789
+ SupportedStyles:
790
+ - normal
791
+ - indented_internal_methods
792
+ Reference:
793
+ # A reference to `EnforcedStyle: indented_internal_methods`.
794
+ - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
795
+
796
+ Layout/IndentationWidth:
797
+ Description: 'Use 2 spaces for indentation.'
798
+ StyleGuide: '#spaces-indentation'
799
+ Enabled: true
800
+ VersionAdded: '0.49'
801
+ # Number of spaces for each indentation level.
802
+ Width: 2
803
+ IgnoredPatterns: []
804
+
805
+ Layout/InitialIndentation:
806
+ Description: >-
807
+ Checks the indentation of the first non-blank non-comment line in a file.
808
+ Enabled: true
809
+ VersionAdded: '0.49'
810
+
811
+ Layout/LeadingCommentSpace:
812
+ Description: 'Comments should start with a space.'
813
+ StyleGuide: '#hash-space'
814
+ Enabled: true
815
+ VersionAdded: '0.49'
816
+ VersionChanged: '0.73'
817
+ AllowDoxygenCommentStyle: false
818
+ AllowGemfileRubyComment: false
819
+
820
+ Layout/LeadingEmptyLines:
821
+ Description: Check for unnecessary blank lines at the beginning of a file.
822
+ Enabled: true
823
+ VersionAdded: '0.57'
824
+ VersionChanged: '0.77'
825
+
826
+ Layout/LineLength:
827
+ Description: 'Limit lines to 80 characters.'
828
+ StyleGuide: '#80-character-limits'
829
+ Enabled: true
830
+ VersionAdded: '0.25'
831
+ VersionChanged: '0.78'
832
+ AutoCorrect: false
833
+ Max: 80
834
+ # To make it possible to copy or click on URIs in the code, we allow lines
835
+ # containing a URI to be longer than Max.
836
+ AllowHeredoc: true
837
+ AllowURI: true
838
+ URISchemes:
839
+ - http
840
+ - https
841
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
842
+ # directives like '# rubocop: enable ...' when calculating a line's length.
843
+ IgnoreCopDirectives: true
844
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
845
+ # elements. Strings will be converted to Regexp objects. A line that matches
846
+ # any regular expression listed in this option will be ignored by LineLength.
847
+ IgnoredPatterns: []
848
+
849
+ Layout/MultilineArrayBraceLayout:
850
+ Description: >-
851
+ Checks that the closing brace in an array literal is
852
+ either on the same line as the last array element, or
853
+ a new line.
854
+ Enabled: true
855
+ VersionAdded: '0.49'
856
+ EnforcedStyle: symmetrical
857
+ SupportedStyles:
858
+ # symmetrical: closing brace is positioned in same way as opening brace
859
+ # new_line: closing brace is always on a new line
860
+ # same_line: closing brace is always on the same line as last element
861
+ - symmetrical
862
+ - new_line
863
+ - same_line
864
+
865
+ Layout/MultilineArrayLineBreaks:
866
+ Description: >-
867
+ Checks that each item in a multi-line array literal
868
+ starts on a separate line.
869
+ Enabled: false
870
+ VersionAdded: '0.67'
871
+
872
+ Layout/MultilineAssignmentLayout:
873
+ Description: 'Check for a newline after the assignment operator in multi-line assignments.'
874
+ StyleGuide: '#indent-conditional-assignment'
875
+ Enabled: false
876
+ VersionAdded: '0.49'
877
+ # The types of assignments which are subject to this rule.
878
+ SupportedTypes:
879
+ - block
880
+ - case
881
+ - class
882
+ - if
883
+ - kwbegin
884
+ - module
885
+ EnforcedStyle: new_line
886
+ SupportedStyles:
887
+ # Ensures that the assignment operator and the rhs are on the same line for
888
+ # the set of supported types.
889
+ - same_line
890
+ # Ensures that the assignment operator and the rhs are on separate lines
891
+ # for the set of supported types.
892
+ - new_line
893
+
894
+ Layout/MultilineBlockLayout:
895
+ Description: 'Ensures newlines after multiline block do statements.'
896
+ Enabled: true
897
+ VersionAdded: '0.49'
898
+
899
+ Layout/MultilineHashBraceLayout:
900
+ Description: >-
901
+ Checks that the closing brace in a hash literal is
902
+ either on the same line as the last hash element, or
903
+ a new line.
904
+ Enabled: true
905
+ VersionAdded: '0.49'
906
+ EnforcedStyle: symmetrical
907
+ SupportedStyles:
908
+ # symmetrical: closing brace is positioned in same way as opening brace
909
+ # new_line: closing brace is always on a new line
910
+ # same_line: closing brace is always on same line as last element
911
+ - symmetrical
912
+ - new_line
913
+ - same_line
914
+
915
+ Layout/MultilineHashKeyLineBreaks:
916
+ Description: >-
917
+ Checks that each item in a multi-line hash literal
918
+ starts on a separate line.
919
+ Enabled: false
920
+ VersionAdded: '0.67'
921
+
922
+ Layout/MultilineMethodArgumentLineBreaks:
923
+ Description: >-
924
+ Checks that each argument in a multi-line method call
925
+ starts on a separate line.
926
+ Enabled: false
927
+ VersionAdded: '0.67'
928
+
929
+ Layout/MultilineMethodCallBraceLayout:
930
+ Description: >-
931
+ Checks that the closing brace in a method call is
932
+ either on the same line as the last method argument, or
933
+ a new line.
934
+ Enabled: true
935
+ VersionAdded: '0.49'
936
+ EnforcedStyle: symmetrical
937
+ SupportedStyles:
938
+ # symmetrical: closing brace is positioned in same way as opening brace
939
+ # new_line: closing brace is always on a new line
940
+ # same_line: closing brace is always on the same line as last argument
941
+ - symmetrical
942
+ - new_line
943
+ - same_line
944
+
945
+ Layout/MultilineMethodCallIndentation:
946
+ Description: >-
947
+ Checks indentation of method calls with the dot operator
948
+ that span more than one line.
949
+ Enabled: true
950
+ VersionAdded: '0.49'
951
+ EnforcedStyle: aligned
952
+ SupportedStyles:
953
+ - aligned
954
+ - indented
955
+ - indented_relative_to_receiver
956
+ # By default, the indentation width from Layout/IndentationWidth is used
957
+ # But it can be overridden by setting this parameter
958
+ IndentationWidth: ~
959
+
960
+ Layout/MultilineMethodDefinitionBraceLayout:
961
+ Description: >-
962
+ Checks that the closing brace in a method definition is
963
+ either on the same line as the last method parameter, or
964
+ a new line.
965
+ Enabled: true
966
+ VersionAdded: '0.49'
967
+ EnforcedStyle: symmetrical
968
+ SupportedStyles:
969
+ # symmetrical: closing brace is positioned in same way as opening brace
970
+ # new_line: closing brace is always on a new line
971
+ # same_line: closing brace is always on the same line as last parameter
972
+ - symmetrical
973
+ - new_line
974
+ - same_line
975
+
976
+ Layout/MultilineOperationIndentation:
977
+ Description: >-
978
+ Checks indentation of binary operations that span more than
979
+ one line.
980
+ Enabled: true
981
+ VersionAdded: '0.49'
982
+ EnforcedStyle: aligned
983
+ SupportedStyles:
984
+ - aligned
985
+ - indented
986
+ # By default, the indentation width from `Layout/IndentationWidth` is used
987
+ # But it can be overridden by setting this parameter
988
+ IndentationWidth: ~
989
+
990
+ Layout/ParameterAlignment:
991
+ Description: >-
992
+ Align the parameters of a method definition if they span more
993
+ than one line.
994
+ StyleGuide: '#no-double-indent'
995
+ Enabled: true
996
+ VersionAdded: '0.49'
997
+ VersionChanged: '0.77'
998
+ # Alignment of parameters in multi-line method calls.
999
+ #
1000
+ # The `with_first_parameter` style aligns the following lines along the same
1001
+ # column as the first parameter.
1002
+ #
1003
+ # def method_foo(a,
1004
+ # b)
1005
+ #
1006
+ # The `with_fixed_indentation` style aligns the following lines with one
1007
+ # level of indentation relative to the start of the line with the method call.
1008
+ #
1009
+ # def method_foo(a,
1010
+ # b)
1011
+ EnforcedStyle: with_first_parameter
1012
+ SupportedStyles:
1013
+ - with_first_parameter
1014
+ - with_fixed_indentation
1015
+ # By default, the indentation width from Layout/IndentationWidth is used
1016
+ # But it can be overridden by setting this parameter
1017
+ IndentationWidth: ~
1018
+
1019
+ Layout/RescueEnsureAlignment:
1020
+ Description: 'Align rescues and ensures correctly.'
1021
+ Enabled: true
1022
+ VersionAdded: '0.49'
1023
+
1024
+ Layout/SpaceAfterColon:
1025
+ Description: 'Use spaces after colons.'
1026
+ StyleGuide: '#spaces-operators'
1027
+ Enabled: true
1028
+ VersionAdded: '0.49'
1029
+
1030
+ Layout/SpaceAfterComma:
1031
+ Description: 'Use spaces after commas.'
1032
+ StyleGuide: '#spaces-operators'
1033
+ Enabled: true
1034
+ VersionAdded: '0.49'
1035
+
1036
+ Layout/SpaceAfterMethodName:
1037
+ Description: >-
1038
+ Do not put a space between a method name and the opening
1039
+ parenthesis in a method definition.
1040
+ StyleGuide: '#parens-no-spaces'
1041
+ Enabled: true
1042
+ VersionAdded: '0.49'
1043
+
1044
+ Layout/SpaceAfterNot:
1045
+ Description: Tracks redundant space after the ! operator.
1046
+ StyleGuide: '#no-space-bang'
1047
+ Enabled: true
1048
+ VersionAdded: '0.49'
1049
+
1050
+ Layout/SpaceAfterSemicolon:
1051
+ Description: 'Use spaces after semicolons.'
1052
+ StyleGuide: '#spaces-operators'
1053
+ Enabled: true
1054
+ VersionAdded: '0.49'
1055
+
1056
+ Layout/SpaceAroundBlockParameters:
1057
+ Description: 'Checks the spacing inside and after block parameters pipes.'
1058
+ Enabled: true
1059
+ VersionAdded: '0.49'
1060
+ EnforcedStyleInsidePipes: no_space
1061
+ SupportedStylesInsidePipes:
1062
+ - space
1063
+ - no_space
1064
+
1065
+ Layout/SpaceAroundEqualsInParameterDefault:
1066
+ Description: >-
1067
+ Checks that the equals signs in parameter default assignments
1068
+ have or don't have surrounding space depending on
1069
+ configuration.
1070
+ StyleGuide: '#spaces-around-equals'
1071
+ Enabled: true
1072
+ VersionAdded: '0.49'
1073
+ EnforcedStyle: space
1074
+ SupportedStyles:
1075
+ - space
1076
+ - no_space
1077
+
1078
+ Layout/SpaceAroundKeyword:
1079
+ Description: 'Use a space around keywords if appropriate.'
1080
+ Enabled: true
1081
+ VersionAdded: '0.49'
1082
+
1083
+ Layout/SpaceAroundOperators:
1084
+ Description: 'Use a single space around operators.'
1085
+ StyleGuide: '#spaces-operators'
1086
+ Enabled: true
1087
+ VersionAdded: '0.49'
1088
+ # When `true`, allows most uses of extra spacing if the intent is to align
1089
+ # with an operator on the previous or next line, not counting empty lines
1090
+ # or comment lines.
1091
+ AllowForAlignment: true
1092
+ EnforcedStyleForExponentOperator: no_space
1093
+ SupportedStylesForExponentOperator:
1094
+ - space
1095
+ - no_space
1096
+
1097
+ Layout/SpaceBeforeBlockBraces:
1098
+ Description: >-
1099
+ Checks that the left block brace has or doesn't have space
1100
+ before it.
1101
+ Enabled: true
1102
+ VersionAdded: '0.49'
1103
+ EnforcedStyle: space
1104
+ SupportedStyles:
1105
+ - space
1106
+ - no_space
1107
+ EnforcedStyleForEmptyBraces: space
1108
+ SupportedStylesForEmptyBraces:
1109
+ - space
1110
+ - no_space
1111
+ VersionChanged: '0.52.1'
1112
+
1113
+ Layout/SpaceBeforeComma:
1114
+ Description: 'No spaces before commas.'
1115
+ Enabled: true
1116
+ VersionAdded: '0.49'
1117
+
1118
+ Layout/SpaceBeforeComment:
1119
+ Description: >-
1120
+ Checks for missing space between code and a comment on the
1121
+ same line.
1122
+ Enabled: true
1123
+ VersionAdded: '0.49'
1124
+
1125
+ Layout/SpaceBeforeFirstArg:
1126
+ Description: >-
1127
+ Checks that exactly one space is used between a method name
1128
+ and the first argument for method calls without parentheses.
1129
+ Enabled: true
1130
+ VersionAdded: '0.49'
1131
+ # When `true`, allows most uses of extra spacing if the intent is to align
1132
+ # things with the previous or next line, not counting empty lines or comment
1133
+ # lines.
1134
+ AllowForAlignment: true
1135
+
1136
+ Layout/SpaceBeforeSemicolon:
1137
+ Description: 'No spaces before semicolons.'
1138
+ Enabled: true
1139
+ VersionAdded: '0.49'
1140
+
1141
+ Layout/SpaceInLambdaLiteral:
1142
+ Description: 'Checks for spaces in lambda literals.'
1143
+ Enabled: true
1144
+ VersionAdded: '0.49'
1145
+ EnforcedStyle: require_no_space
1146
+ SupportedStyles:
1147
+ - require_no_space
1148
+ - require_space
1149
+
1150
+ Layout/SpaceInsideArrayLiteralBrackets:
1151
+ Description: 'Checks the spacing inside array literal brackets.'
1152
+ Enabled: true
1153
+ VersionAdded: '0.52'
1154
+ EnforcedStyle: no_space
1155
+ SupportedStyles:
1156
+ - space
1157
+ - no_space
1158
+ # 'compact' normally requires a space inside the brackets, with the exception
1159
+ # that successive left brackets or right brackets are collapsed together
1160
+ - compact
1161
+ EnforcedStyleForEmptyBrackets: no_space
1162
+ SupportedStylesForEmptyBrackets:
1163
+ - space
1164
+ - no_space
1165
+
1166
+ Layout/SpaceInsideArrayPercentLiteral:
1167
+ Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
1168
+ Enabled: true
1169
+ VersionAdded: '0.49'
1170
+
1171
+ Layout/SpaceInsideBlockBraces:
1172
+ Description: >-
1173
+ Checks that block braces have or don't have surrounding space.
1174
+ For blocks taking parameters, checks that the left brace has
1175
+ or doesn't have trailing space.
1176
+ Enabled: true
1177
+ VersionAdded: '0.49'
1178
+ EnforcedStyle: space
1179
+ SupportedStyles:
1180
+ - space
1181
+ - no_space
1182
+ EnforcedStyleForEmptyBraces: no_space
1183
+ SupportedStylesForEmptyBraces:
1184
+ - space
1185
+ - no_space
1186
+ # Space between `{` and `|`. Overrides `EnforcedStyle` if there is a conflict.
1187
+ SpaceBeforeBlockParameters: true
1188
+
1189
+ Layout/SpaceInsideHashLiteralBraces:
1190
+ Description: "Use spaces inside hash literal braces - or don't."
1191
+ StyleGuide: '#spaces-operators'
1192
+ Enabled: true
1193
+ VersionAdded: '0.49'
1194
+ EnforcedStyle: space
1195
+ SupportedStyles:
1196
+ - space
1197
+ - no_space
1198
+ # 'compact' normally requires a space inside hash braces, with the exception
1199
+ # that successive left braces or right braces are collapsed together
1200
+ - compact
1201
+ EnforcedStyleForEmptyBraces: no_space
1202
+ SupportedStylesForEmptyBraces:
1203
+ - space
1204
+ - no_space
1205
+
1206
+
1207
+ Layout/SpaceInsideParens:
1208
+ Description: 'No spaces after ( or before ).'
1209
+ StyleGuide: '#spaces-braces'
1210
+ Enabled: true
1211
+ VersionAdded: '0.49'
1212
+ VersionChanged: '0.55'
1213
+ EnforcedStyle: no_space
1214
+ SupportedStyles:
1215
+ - space
1216
+ - no_space
1217
+
1218
+ Layout/SpaceInsidePercentLiteralDelimiters:
1219
+ Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
1220
+ Enabled: true
1221
+ VersionAdded: '0.49'
1222
+
1223
+ Layout/SpaceInsideRangeLiteral:
1224
+ Description: 'No spaces inside range literals.'
1225
+ StyleGuide: '#no-space-inside-range-literals'
1226
+ Enabled: true
1227
+ VersionAdded: '0.49'
1228
+
1229
+ Layout/SpaceInsideReferenceBrackets:
1230
+ Description: 'Checks the spacing inside referential brackets.'
1231
+ Enabled: true
1232
+ VersionAdded: '0.52'
1233
+ VersionChanged: '0.53'
1234
+ EnforcedStyle: no_space
1235
+ SupportedStyles:
1236
+ - space
1237
+ - no_space
1238
+ EnforcedStyleForEmptyBrackets: no_space
1239
+ SupportedStylesForEmptyBrackets:
1240
+ - space
1241
+ - no_space
1242
+
1243
+ Layout/SpaceInsideStringInterpolation:
1244
+ Description: 'Checks for padding/surrounding spaces inside string interpolation.'
1245
+ StyleGuide: '#string-interpolation'
1246
+ Enabled: true
1247
+ VersionAdded: '0.49'
1248
+ EnforcedStyle: no_space
1249
+ SupportedStyles:
1250
+ - space
1251
+ - no_space
1252
+
1253
+ Layout/Tab:
1254
+ Description: 'No hard tabs.'
1255
+ StyleGuide: '#spaces-indentation'
1256
+ Enabled: true
1257
+ VersionAdded: '0.49'
1258
+ VersionChanged: '0.51'
1259
+ # By default, the indentation width from Layout/IndentationWidth is used
1260
+ # But it can be overridden by setting this parameter
1261
+ # It is used during auto-correction to determine how many spaces should
1262
+ # replace each tab.
1263
+ IndentationWidth: ~
1264
+
1265
+ Layout/TrailingEmptyLines:
1266
+ Description: 'Checks trailing blank lines and final newline.'
1267
+ StyleGuide: '#newline-eof'
1268
+ Enabled: true
1269
+ VersionAdded: '0.49'
1270
+ VersionChanged: '0.77'
1271
+ EnforcedStyle: final_newline
1272
+ SupportedStyles:
1273
+ - final_newline
1274
+ - final_blank_line
1275
+
1276
+ Layout/TrailingWhitespace:
1277
+ Description: 'Avoid trailing whitespace.'
1278
+ StyleGuide: '#no-trailing-whitespace'
1279
+ Enabled: true
1280
+ VersionAdded: '0.49'
1281
+ VersionChanged: '0.55'
1282
+ AllowInHeredoc: false
1283
+
1284
+ #################### Lint ##################################
1285
+ ### Warnings
1286
+
1287
+ Lint/AmbiguousBlockAssociation:
1288
+ Description: >-
1289
+ Checks for ambiguous block association with method when param passed without
1290
+ parentheses.
1291
+ StyleGuide: '#syntax'
1292
+ Enabled: true
1293
+ VersionAdded: '0.48'
1294
+
1295
+ Lint/AmbiguousOperator:
1296
+ Description: >-
1297
+ Checks for ambiguous operators in the first argument of a
1298
+ method invocation without parentheses.
1299
+ StyleGuide: '#method-invocation-parens'
1300
+ Enabled: true
1301
+ VersionAdded: '0.17'
1302
+
1303
+ Lint/AmbiguousRegexpLiteral:
1304
+ Description: >-
1305
+ Checks for ambiguous regexp literals in the first argument of
1306
+ a method invocation without parentheses.
1307
+ Enabled: true
1308
+ VersionAdded: '0.17'
1309
+
1310
+ Lint/AssignmentInCondition:
1311
+ Description: "Don't use assignment in conditions."
1312
+ StyleGuide: '#safe-assignment-in-condition'
1313
+ Enabled: true
1314
+ VersionAdded: '0.9'
1315
+ AllowSafeAssignment: true
1316
+
1317
+ Lint/BigDecimalNew:
1318
+ Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
1319
+ Enabled: true
1320
+ VersionAdded: '0.53'
1321
+
1322
+ Lint/BooleanSymbol:
1323
+ Description: 'Check for `:true` and `:false` symbols.'
1324
+ Enabled: true
1325
+ VersionAdded: '0.50'
1326
+ VersionChanged: '0.81'
1327
+
1328
+ Lint/CircularArgumentReference:
1329
+ Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
1330
+ Enabled: true
1331
+ VersionAdded: '0.33'
1332
+
1333
+ Lint/Debugger:
1334
+ Description: 'Check for debugger calls.'
1335
+ Enabled: true
1336
+ VersionAdded: '0.14'
1337
+ VersionChanged: '0.49'
1338
+
1339
+ Lint/DeprecatedClassMethods:
1340
+ Description: 'Check for deprecated class method calls.'
1341
+ Enabled: true
1342
+ VersionAdded: '0.19'
1343
+
1344
+ Lint/DisjunctiveAssignmentInConstructor:
1345
+ Description: 'In constructor, plain assignment is preferred over disjunctive.'
1346
+ Enabled: true
1347
+ Safe: false
1348
+ VersionAdded: '0.62'
1349
+
1350
+ Lint/DuplicateCaseCondition:
1351
+ Description: 'Do not repeat values in case conditionals.'
1352
+ Enabled: true
1353
+ VersionAdded: '0.45'
1354
+
1355
+ Lint/DuplicateHashKey:
1356
+ Description: 'Check for duplicate keys in hash literals.'
1357
+ Enabled: true
1358
+ VersionAdded: '0.34'
1359
+ VersionChanged: '0.77'
1360
+
1361
+ Lint/DuplicateMethods:
1362
+ Description: 'Check for duplicate method definitions.'
1363
+ Enabled: true
1364
+ VersionAdded: '0.29'
1365
+
1366
+ Lint/EachWithObjectArgument:
1367
+ Description: 'Check for immutable argument given to each_with_object.'
1368
+ Enabled: true
1369
+ VersionAdded: '0.31'
1370
+
1371
+ Lint/ElseLayout:
1372
+ Description: 'Check for odd code arrangement in an else block.'
1373
+ Enabled: true
1374
+ VersionAdded: '0.17'
1375
+
1376
+ Lint/EmptyEnsure:
1377
+ Description: 'Checks for empty ensure block.'
1378
+ Enabled: true
1379
+ VersionAdded: '0.10'
1380
+ VersionChanged: '0.48'
1381
+ AutoCorrect: false
1382
+
1383
+ Lint/EmptyExpression:
1384
+ Description: 'Checks for empty expressions.'
1385
+ Enabled: true
1386
+ VersionAdded: '0.45'
1387
+
1388
+ Lint/EmptyInterpolation:
1389
+ Description: 'Checks for empty string interpolation.'
1390
+ Enabled: true
1391
+ VersionAdded: '0.20'
1392
+ VersionChanged: '0.45'
1393
+
1394
+ Lint/EmptyWhen:
1395
+ Description: 'Checks for `when` branches with empty bodies.'
1396
+ Enabled: true
1397
+ VersionAdded: '0.45'
1398
+
1399
+ Lint/EnsureReturn:
1400
+ Description: 'Do not use return in an ensure block.'
1401
+ StyleGuide: '#no-return-ensure'
1402
+ Enabled: true
1403
+ VersionAdded: '0.9'
1404
+
1405
+ Lint/ErbNewArguments:
1406
+ Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
1407
+ Enabled: true
1408
+ VersionAdded: '0.56'
1409
+
1410
+ Lint/FlipFlop:
1411
+ Description: 'Checks for flip-flops.'
1412
+ StyleGuide: '#no-flip-flops'
1413
+ Enabled: true
1414
+ VersionAdded: '0.16'
1415
+
1416
+ Lint/FloatOutOfRange:
1417
+ Description: >-
1418
+ Catches floating-point literals too large or small for Ruby to
1419
+ represent.
1420
+ Enabled: true
1421
+ VersionAdded: '0.36'
1422
+
1423
+ Lint/FormatParameterMismatch:
1424
+ Description: 'The number of parameters to format/sprint must match the fields.'
1425
+ Enabled: true
1426
+ VersionAdded: '0.33'
1427
+
1428
+ Lint/HeredocMethodCallPosition:
1429
+ Description: >-
1430
+ Checks for the ordering of a method call where
1431
+ the receiver of the call is a HEREDOC.
1432
+ Enabled: false
1433
+ StyleGuide: '#heredoc-method-calls'
1434
+ VersionAdded: '0.68'
1435
+
1436
+ Lint/ImplicitStringConcatenation:
1437
+ Description: >-
1438
+ Checks for adjacent string literals on the same line, which
1439
+ could better be represented as a single string literal.
1440
+ Enabled: true
1441
+ VersionAdded: '0.36'
1442
+
1443
+ Lint/IneffectiveAccessModifier:
1444
+ Description: >-
1445
+ Checks for attempts to use `private` or `protected` to set
1446
+ the visibility of a class method, which does not work.
1447
+ Enabled: true
1448
+ VersionAdded: '0.36'
1449
+
1450
+ Lint/InheritException:
1451
+ Description: 'Avoid inheriting from the `Exception` class.'
1452
+ Enabled: true
1453
+ VersionAdded: '0.41'
1454
+ # The default base class in favour of `Exception`.
1455
+ EnforcedStyle: runtime_error
1456
+ SupportedStyles:
1457
+ - runtime_error
1458
+ - standard_error
1459
+
1460
+ Lint/InterpolationCheck:
1461
+ Description: 'Raise warning for interpolation in single q strs.'
1462
+ Enabled: true
1463
+ VersionAdded: '0.50'
1464
+
1465
+ Lint/LiteralAsCondition:
1466
+ Description: 'Checks of literals used in conditions.'
1467
+ Enabled: true
1468
+ VersionAdded: '0.51'
1469
+
1470
+ Lint/LiteralInInterpolation:
1471
+ Description: 'Checks for literals used in interpolation.'
1472
+ Enabled: true
1473
+ VersionAdded: '0.19'
1474
+ VersionChanged: '0.32'
1475
+
1476
+ Lint/Loop:
1477
+ Description: >-
1478
+ Use Kernel#loop with break rather than begin/end/until or
1479
+ begin/end/while for post-loop tests.
1480
+ StyleGuide: '#loop-with-break'
1481
+ Enabled: true
1482
+ VersionAdded: '0.9'
1483
+
1484
+ Lint/MissingCopEnableDirective:
1485
+ Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
1486
+ Enabled: true
1487
+ VersionAdded: '0.52'
1488
+ # Maximum number of consecutive lines the cop can be disabled for.
1489
+ # 0 allows only single-line disables
1490
+ # 1 would mean the maximum allowed is the following:
1491
+ # # rubocop:disable SomeCop
1492
+ # a = 1
1493
+ # # rubocop:enable SomeCop
1494
+ # .inf for any size
1495
+ MaximumRangeSize: .inf
1496
+
1497
+ Lint/MultipleComparison:
1498
+ Description: "Use `&&` operator to compare multiple values."
1499
+ Enabled: true
1500
+ VersionAdded: '0.47'
1501
+ VersionChanged: '0.77'
1502
+
1503
+ Lint/NestedMethodDefinition:
1504
+ Description: 'Do not use nested method definitions.'
1505
+ StyleGuide: '#no-nested-methods'
1506
+ Enabled: true
1507
+ VersionAdded: '0.32'
1508
+
1509
+ Lint/NestedPercentLiteral:
1510
+ Description: 'Checks for nested percent literals.'
1511
+ Enabled: true
1512
+ VersionAdded: '0.52'
1513
+
1514
+ Lint/NextWithoutAccumulator:
1515
+ Description: >-
1516
+ Do not omit the accumulator when calling `next`
1517
+ in a `reduce`/`inject` block.
1518
+ Enabled: true
1519
+ VersionAdded: '0.36'
1520
+
1521
+ Lint/NonDeterministicRequireOrder:
1522
+ Description: 'Always sort arrays returned by Dir.glob when requiring files.'
1523
+ Enabled: true
1524
+ VersionAdded: '0.78'
1525
+ Safe: false
1526
+
1527
+ Lint/NonLocalExitFromIterator:
1528
+ Description: 'Do not use return in iterator to cause non-local exit.'
1529
+ Enabled: true
1530
+ VersionAdded: '0.30'
1531
+
1532
+ Lint/NumberConversion:
1533
+ Description: 'Checks unsafe usage of number conversion methods.'
1534
+ Enabled: false
1535
+ VersionAdded: '0.53'
1536
+ VersionChanged: '0.70'
1537
+ SafeAutoCorrect: false
1538
+
1539
+ Lint/OrderedMagicComments:
1540
+ Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
1541
+ Enabled: true
1542
+ VersionAdded: '0.53'
1543
+
1544
+ Lint/ParenthesesAsGroupedExpression:
1545
+ Description: >-
1546
+ Checks for method calls with a space before the opening
1547
+ parenthesis.
1548
+ StyleGuide: '#parens-no-spaces'
1549
+ Enabled: true
1550
+ VersionAdded: '0.12'
1551
+
1552
+ Lint/PercentStringArray:
1553
+ Description: >-
1554
+ Checks for unwanted commas and quotes in %w/%W literals.
1555
+ Enabled: true
1556
+ Safe: false
1557
+ VersionAdded: '0.41'
1558
+
1559
+ Lint/PercentSymbolArray:
1560
+ Description: >-
1561
+ Checks for unwanted commas and colons in %i/%I literals.
1562
+ Enabled: true
1563
+ VersionAdded: '0.41'
1564
+
1565
+ Lint/RaiseException:
1566
+ Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
1567
+ StyleGuide: '#raise-exception'
1568
+ Enabled: pending
1569
+ VersionAdded: '0.81'
1570
+
1571
+ Lint/RandOne:
1572
+ Description: >-
1573
+ Checks for `rand(1)` calls. Such calls always return `0`
1574
+ and most likely a mistake.
1575
+ Enabled: true
1576
+ VersionAdded: '0.36'
1577
+
1578
+ Lint/RedundantCopDisableDirective:
1579
+ Description: >-
1580
+ Checks for rubocop:disable comments that can be removed.
1581
+ Note: this cop is not disabled when disabling all cops.
1582
+ It must be explicitly disabled.
1583
+ Enabled: true
1584
+ VersionAdded: '0.76'
1585
+
1586
+ Lint/RedundantCopEnableDirective:
1587
+ Description: Checks for rubocop:enable comments that can be removed.
1588
+ Enabled: true
1589
+ VersionAdded: '0.76'
1590
+
1591
+ Lint/RedundantRequireStatement:
1592
+ Description: 'Checks for unnecessary `require` statement.'
1593
+ Enabled: true
1594
+ VersionAdded: '0.76'
1595
+
1596
+ Lint/RedundantSplatExpansion:
1597
+ Description: 'Checks for splat unnecessarily being called on literals.'
1598
+ Enabled: true
1599
+ VersionAdded: '0.76'
1600
+
1601
+ Lint/RedundantStringCoercion:
1602
+ Description: 'Checks for Object#to_s usage in string interpolation.'
1603
+ StyleGuide: '#no-to-s'
1604
+ Enabled: true
1605
+ VersionAdded: '0.19'
1606
+ VersionChanged: '0.77'
1607
+
1608
+ Lint/RedundantWithIndex:
1609
+ Description: 'Checks for redundant `with_index`.'
1610
+ Enabled: true
1611
+ VersionAdded: '0.50'
1612
+
1613
+ Lint/RedundantWithObject:
1614
+ Description: 'Checks for redundant `with_object`.'
1615
+ Enabled: true
1616
+ VersionAdded: '0.51'
1617
+
1618
+ Lint/RegexpAsCondition:
1619
+ Description: >-
1620
+ Do not use regexp literal as a condition.
1621
+ The regexp literal matches `$_` implicitly.
1622
+ Enabled: true
1623
+ VersionAdded: '0.51'
1624
+
1625
+ Lint/RequireParentheses:
1626
+ Description: >-
1627
+ Use parentheses in the method call to avoid confusion
1628
+ about precedence.
1629
+ Enabled: true
1630
+ VersionAdded: '0.18'
1631
+
1632
+ Lint/RescueException:
1633
+ Description: 'Avoid rescuing the Exception class.'
1634
+ StyleGuide: '#no-blind-rescues'
1635
+ Enabled: true
1636
+ VersionAdded: '0.9'
1637
+ VersionChanged: '0.27.1'
1638
+
1639
+ Lint/RescueType:
1640
+ Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
1641
+ Enabled: true
1642
+ VersionAdded: '0.49'
1643
+
1644
+ Lint/ReturnInVoidContext:
1645
+ Description: 'Checks for return in void context.'
1646
+ Enabled: true
1647
+ VersionAdded: '0.50'
1648
+
1649
+ Lint/SafeNavigationChain:
1650
+ Description: 'Do not chain ordinary method call after safe navigation operator.'
1651
+ Enabled: true
1652
+ VersionAdded: '0.47'
1653
+ VersionChanged: '0.77'
1654
+ AllowedMethods:
1655
+ - present?
1656
+ - blank?
1657
+ - presence
1658
+ - try
1659
+ - try!
1660
+
1661
+ Lint/SafeNavigationConsistency:
1662
+ Description: >-
1663
+ Check to make sure that if safe navigation is used for a method
1664
+ call in an `&&` or `||` condition that safe navigation is used
1665
+ for all method calls on that same object.
1666
+ Enabled: true
1667
+ VersionAdded: '0.55'
1668
+ VersionChanged: '0.77'
1669
+ AllowedMethods:
1670
+ - present?
1671
+ - blank?
1672
+ - presence
1673
+ - try
1674
+ - try!
1675
+
1676
+ Lint/SafeNavigationWithEmpty:
1677
+ Description: 'Avoid `foo&.empty?` in conditionals.'
1678
+ Enabled: true
1679
+ VersionAdded: '0.62'
1680
+
1681
+ Lint/ScriptPermission:
1682
+ Description: 'Grant script file execute permission.'
1683
+ Enabled: true
1684
+ VersionAdded: '0.49'
1685
+ VersionChanged: '0.50'
1686
+
1687
+ Lint/SendWithMixinArgument:
1688
+ Description: 'Checks for `send` method when using mixin.'
1689
+ Enabled: true
1690
+ VersionAdded: '0.75'
1691
+
1692
+ Lint/ShadowedArgument:
1693
+ Description: 'Avoid reassigning arguments before they were used.'
1694
+ Enabled: true
1695
+ VersionAdded: '0.52'
1696
+ IgnoreImplicitReferences: false
1697
+
1698
+
1699
+ Lint/ShadowedException:
1700
+ Description: >-
1701
+ Avoid rescuing a higher level exception
1702
+ before a lower level exception.
1703
+ Enabled: true
1704
+ VersionAdded: '0.41'
1705
+
1706
+ Lint/ShadowingOuterLocalVariable:
1707
+ Description: >-
1708
+ Do not use the same name as outer local variable
1709
+ for block arguments or block local variables.
1710
+ Enabled: true
1711
+ VersionAdded: '0.9'
1712
+
1713
+ Lint/StructNewOverride:
1714
+ Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
1715
+ Enabled: pending
1716
+ VersionAdded: '0.81'
1717
+
1718
+ Lint/SuppressedException:
1719
+ Description: "Don't suppress exceptions."
1720
+ StyleGuide: '#dont-hide-exceptions'
1721
+ Enabled: true
1722
+ AllowComments: true
1723
+ VersionAdded: '0.9'
1724
+ VersionChanged: '0.81'
1725
+
1726
+ Lint/Syntax:
1727
+ Description: 'Checks syntax error.'
1728
+ Enabled: true
1729
+ VersionAdded: '0.9'
1730
+
1731
+
1732
+ Lint/ToJSON:
1733
+ Description: 'Ensure #to_json includes an optional argument.'
1734
+ Enabled: true
1735
+ VersionAdded: '0.66'
1736
+
1737
+ Lint/UnderscorePrefixedVariableName:
1738
+ Description: 'Do not use prefix `_` for a variable that is used.'
1739
+ Enabled: true
1740
+ VersionAdded: '0.21'
1741
+ AllowKeywordBlockArguments: false
1742
+
1743
+ Lint/UnifiedInteger:
1744
+ Description: 'Use Integer instead of Fixnum or Bignum.'
1745
+ Enabled: true
1746
+ VersionAdded: '0.43'
1747
+
1748
+ Lint/UnreachableCode:
1749
+ Description: 'Unreachable code.'
1750
+ Enabled: true
1751
+ VersionAdded: '0.9'
1752
+
1753
+ Lint/UnusedBlockArgument:
1754
+ Description: 'Checks for unused block arguments.'
1755
+ StyleGuide: '#underscore-unused-vars'
1756
+ Enabled: true
1757
+ VersionAdded: '0.21'
1758
+ VersionChanged: '0.22'
1759
+ IgnoreEmptyBlocks: true
1760
+ AllowUnusedKeywordArguments: false
1761
+
1762
+ Lint/UnusedMethodArgument:
1763
+ Description: 'Checks for unused method arguments.'
1764
+ StyleGuide: '#underscore-unused-vars'
1765
+ Enabled: true
1766
+ VersionAdded: '0.21'
1767
+ VersionChanged: '0.81'
1768
+ AllowUnusedKeywordArguments: false
1769
+ IgnoreEmptyMethods: true
1770
+ IgnoreNotImplementedMethods: true
1771
+
1772
+ Lint/UriEscapeUnescape:
1773
+ Description: >-
1774
+ `URI.escape` method is obsolete and should not be used. Instead, use
1775
+ `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component`
1776
+ depending on your specific use case.
1777
+ Also `URI.unescape` method is obsolete and should not be used. Instead, use
1778
+ `CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
1779
+ depending on your specific use case.
1780
+ Enabled: true
1781
+ VersionAdded: '0.50'
1782
+
1783
+ Lint/UriRegexp:
1784
+ Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.'
1785
+ Enabled: true
1786
+ VersionAdded: '0.50'
1787
+
1788
+ Lint/UselessAccessModifier:
1789
+ Description: 'Checks for useless access modifiers.'
1790
+ Enabled: true
1791
+ VersionAdded: '0.20'
1792
+ VersionChanged: '0.47'
1793
+ ContextCreatingMethods: []
1794
+ MethodCreatingMethods: []
1795
+
1796
+ Lint/UselessAssignment:
1797
+ Description: 'Checks for useless assignment to a local variable.'
1798
+ StyleGuide: '#underscore-unused-vars'
1799
+ Enabled: true
1800
+ VersionAdded: '0.11'
1801
+
1802
+ Lint/UselessComparison:
1803
+ Description: 'Checks for comparison of something with itself.'
1804
+ Enabled: true
1805
+ VersionAdded: '0.11'
1806
+
1807
+ Lint/UselessElseWithoutRescue:
1808
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
1809
+ Enabled: true
1810
+ VersionAdded: '0.17'
1811
+
1812
+ Lint/UselessSetterCall:
1813
+ Description: 'Checks for useless setter call to a local variable.'
1814
+ Enabled: true
1815
+ VersionAdded: '0.13'
1816
+ VersionChanged: '0.80'
1817
+ Safe: false
1818
+
1819
+ Lint/Void:
1820
+ Description: 'Possible use of operator/literal/variable in void context.'
1821
+ Enabled: true
1822
+ VersionAdded: '0.9'
1823
+ CheckForMethodsWithNoSideEffects: false
1824
+
1825
+ #################### Metrics ###############################
1826
+
1827
+ Metrics/AbcSize:
1828
+ Description: >-
1829
+ A calculated magnitude based on number of assignments,
1830
+ branches, and conditions.
1831
+ Reference:
1832
+ - http://c2.com/cgi/wiki?AbcMetric
1833
+ - https://en.wikipedia.org/wiki/ABC_Software_Metric
1834
+ Enabled: true
1835
+ VersionAdded: '0.27'
1836
+ VersionChanged: '0.66'
1837
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
1838
+ # a Float.
1839
+ Max: 15
1840
+
1841
+ Metrics/BlockLength:
1842
+ Description: 'Avoid long blocks with many lines.'
1843
+ Enabled: true
1844
+ VersionAdded: '0.44'
1845
+ VersionChanged: '0.66'
1846
+ CountComments: false # count full line comments?
1847
+ Max: 25
1848
+ ExcludedMethods:
1849
+ # By default, exclude the `#refine` method, as it tends to have larger
1850
+ # associated blocks.
1851
+ - refine
1852
+ Exclude:
1853
+ - '**/*.gemspec'
1854
+
1855
+ Metrics/BlockNesting:
1856
+ Description: 'Avoid excessive block nesting.'
1857
+ StyleGuide: '#three-is-the-number-thou-shalt-count'
1858
+ Enabled: true
1859
+ VersionAdded: '0.25'
1860
+ VersionChanged: '0.47'
1861
+ CountBlocks: false
1862
+ Max: 3
1863
+
1864
+ Metrics/ClassLength:
1865
+ Description: 'Avoid classes longer than 100 lines of code.'
1866
+ Enabled: true
1867
+ VersionAdded: '0.25'
1868
+ CountComments: false # count full line comments?
1869
+ Max: 100
1870
+
1871
+ # Avoid complex methods.
1872
+ Metrics/CyclomaticComplexity:
1873
+ Description: >-
1874
+ A complexity metric that is strongly correlated to the number
1875
+ of test cases needed to validate a method.
1876
+ Enabled: true
1877
+ VersionAdded: '0.25'
1878
+ Max: 6
1879
+
1880
+ Metrics/MethodLength:
1881
+ Description: 'Avoid methods longer than 10 lines of code.'
1882
+ StyleGuide: '#short-methods'
1883
+ Enabled: true
1884
+ VersionAdded: '0.25'
1885
+ VersionChanged: '0.59.2'
1886
+ CountComments: false # count full line comments?
1887
+ Max: 10
1888
+ ExcludedMethods: []
1889
+
1890
+ Metrics/ModuleLength:
1891
+ Description: 'Avoid modules longer than 100 lines of code.'
1892
+ Enabled: true
1893
+ VersionAdded: '0.31'
1894
+ CountComments: false # count full line comments?
1895
+ Max: 100
1896
+
1897
+ Metrics/ParameterLists:
1898
+ Description: 'Avoid parameter lists longer than three or four parameters.'
1899
+ StyleGuide: '#too-many-params'
1900
+ Enabled: true
1901
+ VersionAdded: '0.25'
1902
+ Max: 5
1903
+ CountKeywordArgs: true
1904
+
1905
+ Metrics/PerceivedComplexity:
1906
+ Description: >-
1907
+ A complexity metric geared towards measuring complexity for a
1908
+ human reader.
1909
+ Enabled: true
1910
+ VersionAdded: '0.25'
1911
+ Max: 7
1912
+
1913
+ ################## Migration #############################
1914
+
1915
+ Migration/DepartmentName:
1916
+ Description: >-
1917
+ Check that cop names in rubocop:disable (etc) comments are
1918
+ given with department name.
1919
+ Enabled: true
1920
+ VersionAdded: '0.75'
1921
+
1922
+ #################### Naming ##############################
1923
+
1924
+ Naming/AccessorMethodName:
1925
+ Description: Check the naming of accessor methods for get_/set_.
1926
+ StyleGuide: '#accessor_mutator_method_names'
1927
+ Enabled: true
1928
+ VersionAdded: '0.50'
1929
+
1930
+ Naming/AsciiIdentifiers:
1931
+ Description: 'Use only ascii symbols in identifiers.'
1932
+ StyleGuide: '#english-identifiers'
1933
+ Enabled: true
1934
+ VersionAdded: '0.50'
1935
+
1936
+ Naming/BinaryOperatorParameterName:
1937
+ Description: 'When defining binary operators, name the argument other.'
1938
+ StyleGuide: '#other-arg'
1939
+ Enabled: true
1940
+ VersionAdded: '0.50'
1941
+
1942
+ Naming/BlockParameterName:
1943
+ Description: >-
1944
+ Checks for block parameter names that contain capital letters,
1945
+ end in numbers, or do not meet a minimal length.
1946
+ Enabled: true
1947
+ VersionAdded: '0.53'
1948
+ VersionChanged: '0.77'
1949
+ # Parameter names may be equal to or greater than this value
1950
+ MinNameLength: 1
1951
+ AllowNamesEndingInNumbers: true
1952
+ # Allowed names that will not register an offense
1953
+ AllowedNames: []
1954
+ # Forbidden names that will register an offense
1955
+ ForbiddenNames: []
1956
+
1957
+ Naming/ClassAndModuleCamelCase:
1958
+ Description: 'Use CamelCase for classes and modules.'
1959
+ StyleGuide: '#camelcase-classes'
1960
+ Enabled: true
1961
+ VersionAdded: '0.50'
1962
+
1963
+ Naming/ConstantName:
1964
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
1965
+ StyleGuide: '#screaming-snake-case'
1966
+ Enabled: true
1967
+ VersionAdded: '0.50'
1968
+
1969
+ Naming/FileName:
1970
+ Description: 'Use snake_case for source file names.'
1971
+ StyleGuide: '#snake-case-files'
1972
+ Enabled: true
1973
+ VersionAdded: '0.50'
1974
+ # Camel case file names listed in `AllCops:Include` and all file names listed
1975
+ # in `AllCops:Exclude` are excluded by default. Add extra excludes here.
1976
+ Exclude: []
1977
+ # When `true`, requires that each source file should define a class or module
1978
+ # with a name which matches the file name (converted to ... case).
1979
+ # It further expects it to be nested inside modules which match the names
1980
+ # of subdirectories in its path.
1981
+ ExpectMatchingDefinition: false
1982
+ # If non-`nil`, expect all source file names to match the following regex.
1983
+ # Only the file name itself is matched, not the entire file path.
1984
+ # Use anchors as necessary if you want to match the entire name rather than
1985
+ # just a part of it.
1986
+ Regex: ~
1987
+ # With `IgnoreExecutableScripts` set to `true`, this cop does not
1988
+ # report offending filenames for executable scripts (i.e. source
1989
+ # files with a shebang in the first line).
1990
+ IgnoreExecutableScripts: true
1991
+ AllowedAcronyms:
1992
+ - CLI
1993
+ - DSL
1994
+ - ACL
1995
+ - API
1996
+ - ASCII
1997
+ - CPU
1998
+ - CSS
1999
+ - DNS
2000
+ - EOF
2001
+ - GUID
2002
+ - HTML
2003
+ - HTTP
2004
+ - HTTPS
2005
+ - ID
2006
+ - IP
2007
+ - JSON
2008
+ - LHS
2009
+ - QPS
2010
+ - RAM
2011
+ - RHS
2012
+ - RPC
2013
+ - SLA
2014
+ - SMTP
2015
+ - SQL
2016
+ - SSH
2017
+ - TCP
2018
+ - TLS
2019
+ - TTL
2020
+ - UDP
2021
+ - UI
2022
+ - UID
2023
+ - UUID
2024
+ - URI
2025
+ - URL
2026
+ - UTF8
2027
+ - VM
2028
+ - XML
2029
+ - XMPP
2030
+ - XSRF
2031
+ - XSS
2032
+
2033
+ Naming/HeredocDelimiterCase:
2034
+ Description: 'Use configured case for heredoc delimiters.'
2035
+ StyleGuide: '#heredoc-delimiters'
2036
+ Enabled: true
2037
+ VersionAdded: '0.50'
2038
+ EnforcedStyle: uppercase
2039
+ SupportedStyles:
2040
+ - lowercase
2041
+ - uppercase
2042
+
2043
+ Naming/HeredocDelimiterNaming:
2044
+ Description: 'Use descriptive heredoc delimiters.'
2045
+ StyleGuide: '#heredoc-delimiters'
2046
+ Enabled: true
2047
+ VersionAdded: '0.50'
2048
+ ForbiddenDelimiters:
2049
+ - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
2050
+
2051
+ Naming/MemoizedInstanceVariableName:
2052
+ Description: >-
2053
+ Memoized method name should match memo instance variable name.
2054
+ Enabled: true
2055
+ VersionAdded: '0.53'
2056
+ VersionChanged: '0.58'
2057
+ EnforcedStyleForLeadingUnderscores: disallowed
2058
+ SupportedStylesForLeadingUnderscores:
2059
+ - disallowed
2060
+ - required
2061
+ - optional
2062
+
2063
+ Naming/MethodName:
2064
+ Description: 'Use the configured style when naming methods.'
2065
+ StyleGuide: '#snake-case-symbols-methods-vars'
2066
+ Enabled: true
2067
+ VersionAdded: '0.50'
2068
+ EnforcedStyle: snake_case
2069
+ SupportedStyles:
2070
+ - snake_case
2071
+ - camelCase
2072
+ # Method names matching patterns are always allowed.
2073
+ #
2074
+ # IgnoredPatterns:
2075
+ # - '\A\s*onSelectionBulkChange\s*'
2076
+ # - '\A\s*onSelectionCleared\s*'
2077
+ #
2078
+ IgnoredPatterns: []
2079
+
2080
+ Naming/MethodParameterName:
2081
+ Description: >-
2082
+ Checks for method parameter names that contain capital letters,
2083
+ end in numbers, or do not meet a minimal length.
2084
+ Enabled: true
2085
+ VersionAdded: '0.53'
2086
+ VersionChanged: '0.77'
2087
+ # Parameter names may be equal to or greater than this value
2088
+ MinNameLength: 3
2089
+ AllowNamesEndingInNumbers: true
2090
+ # Allowed names that will not register an offense
2091
+ AllowedNames:
2092
+ - io
2093
+ - id
2094
+ - to
2095
+ - by
2096
+ - 'on'
2097
+ - in
2098
+ - at
2099
+ - ip
2100
+ - db
2101
+ - os
2102
+ - pp
2103
+ # Forbidden names that will register an offense
2104
+ ForbiddenNames: []
2105
+
2106
+ Naming/PredicateName:
2107
+ Description: 'Check the names of predicate methods.'
2108
+ StyleGuide: '#bool-methods-qmark'
2109
+ Enabled: true
2110
+ VersionAdded: '0.50'
2111
+ VersionChanged: '0.77'
2112
+ # Predicate name prefixes.
2113
+ NamePrefix:
2114
+ - is_
2115
+ - has_
2116
+ - have_
2117
+ # Predicate name prefixes that should be removed.
2118
+ ForbiddenPrefixes:
2119
+ - is_
2120
+ - has_
2121
+ - have_
2122
+ # Predicate names which, despite having a forbidden prefix, or no `?`,
2123
+ # should still be accepted
2124
+ AllowedMethods:
2125
+ - is_a?
2126
+ # Method definition macros for dynamically generated methods.
2127
+ MethodDefinitionMacros:
2128
+ - define_method
2129
+ - define_singleton_method
2130
+ # Exclude Rspec specs because there is a strong convention to write spec
2131
+ # helpers in the form of `have_something` or `be_something`.
2132
+ Exclude:
2133
+ - 'spec/**/*'
2134
+
2135
+ Naming/RescuedExceptionsVariableName:
2136
+ Description: 'Use consistent rescued exceptions variables naming.'
2137
+ Enabled: true
2138
+ VersionAdded: '0.67'
2139
+ VersionChanged: '0.68'
2140
+ PreferredName: e
2141
+
2142
+ Naming/VariableName:
2143
+ Description: 'Use the configured style when naming variables.'
2144
+ StyleGuide: '#snake-case-symbols-methods-vars'
2145
+ Enabled: true
2146
+ VersionAdded: '0.50'
2147
+ EnforcedStyle: snake_case
2148
+ SupportedStyles:
2149
+ - snake_case
2150
+ - camelCase
2151
+
2152
+ Naming/VariableNumber:
2153
+ Description: 'Use the configured style when numbering variables.'
2154
+ Enabled: true
2155
+ VersionAdded: '0.50'
2156
+ EnforcedStyle: normalcase
2157
+ SupportedStyles:
2158
+ - snake_case
2159
+ - normalcase
2160
+ - non_integer
2161
+
2162
+ #################### Security ##############################
2163
+
2164
+ Security/Eval:
2165
+ Description: 'The use of eval represents a serious security risk.'
2166
+ Enabled: true
2167
+ VersionAdded: '0.47'
2168
+
2169
+ Security/JSONLoad:
2170
+ Description: >-
2171
+ Prefer usage of `JSON.parse` over `JSON.load` due to potential
2172
+ security issues. See reference for more information.
2173
+ Reference: 'https://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
2174
+ Enabled: true
2175
+ VersionAdded: '0.43'
2176
+ VersionChanged: '0.44'
2177
+ # Autocorrect here will change to a method that may cause crashes depending
2178
+ # on the value of the argument.
2179
+ AutoCorrect: false
2180
+ SafeAutoCorrect: false
2181
+
2182
+ Security/MarshalLoad:
2183
+ Description: >-
2184
+ Avoid using of `Marshal.load` or `Marshal.restore` due to potential
2185
+ security issues. See reference for more information.
2186
+ Reference: 'https://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
2187
+ Enabled: true
2188
+ VersionAdded: '0.47'
2189
+
2190
+ Security/Open:
2191
+ Description: 'The use of Kernel#open represents a serious security risk.'
2192
+ Enabled: true
2193
+ VersionAdded: '0.53'
2194
+ Safe: false
2195
+
2196
+ Security/YAMLLoad:
2197
+ Description: >-
2198
+ Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
2199
+ security issues. See reference for more information.
2200
+ Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
2201
+ Enabled: true
2202
+ VersionAdded: '0.47'
2203
+ SafeAutoCorrect: false
2204
+
2205
+ #################### Style ###############################
2206
+
2207
+ Style/AccessModifierDeclarations:
2208
+ Description: 'Checks style of how access modifiers are used.'
2209
+ Enabled: true
2210
+ VersionAdded: '0.57'
2211
+ VersionChanged: '0.81'
2212
+ EnforcedStyle: group
2213
+ SupportedStyles:
2214
+ - inline
2215
+ - group
2216
+ AllowModifiersOnSymbols: true
2217
+
2218
+ Style/Alias:
2219
+ Description: 'Use alias instead of alias_method.'
2220
+ StyleGuide: '#alias-method-lexically'
2221
+ Enabled: true
2222
+ VersionAdded: '0.9'
2223
+ VersionChanged: '0.36'
2224
+ EnforcedStyle: prefer_alias
2225
+ SupportedStyles:
2226
+ - prefer_alias
2227
+ - prefer_alias_method
2228
+
2229
+ Style/AndOr:
2230
+ Description: 'Use &&/|| instead of and/or.'
2231
+ StyleGuide: '#no-and-or-or'
2232
+ Enabled: true
2233
+ VersionAdded: '0.9'
2234
+ VersionChanged: '0.25'
2235
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
2236
+ # or completely (always).
2237
+ EnforcedStyle: always
2238
+ SupportedStyles:
2239
+ - always
2240
+ - conditionals
2241
+
2242
+ Style/ArrayJoin:
2243
+ Description: 'Use Array#join instead of Array#*.'
2244
+ StyleGuide: '#array-join'
2245
+ Enabled: true
2246
+ VersionAdded: '0.20'
2247
+ VersionChanged: '0.31'
2248
+
2249
+ Style/AsciiComments:
2250
+ Description: 'Use only ascii symbols in comments.'
2251
+ StyleGuide: '#english-comments'
2252
+ Enabled: true
2253
+ VersionAdded: '0.9'
2254
+ VersionChanged: '0.52'
2255
+ AllowedChars: []
2256
+
2257
+ Style/Attr:
2258
+ Description: 'Checks for uses of Module#attr.'
2259
+ StyleGuide: '#attr'
2260
+ Enabled: true
2261
+ VersionAdded: '0.9'
2262
+ VersionChanged: '0.12'
2263
+
2264
+ Style/AutoResourceCleanup:
2265
+ Description: 'Suggests the usage of an auto resource cleanup version of a method (if available).'
2266
+ Enabled: false
2267
+ VersionAdded: '0.30'
2268
+
2269
+ Style/BarePercentLiterals:
2270
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
2271
+ StyleGuide: '#percent-q-shorthand'
2272
+ Enabled: true
2273
+ VersionAdded: '0.25'
2274
+ EnforcedStyle: bare_percent
2275
+ SupportedStyles:
2276
+ - percent_q
2277
+ - bare_percent
2278
+
2279
+ Style/BeginBlock:
2280
+ Description: 'Avoid the use of BEGIN blocks.'
2281
+ StyleGuide: '#no-BEGIN-blocks'
2282
+ Enabled: true
2283
+ VersionAdded: '0.9'
2284
+
2285
+ Style/BlockComments:
2286
+ Description: 'Do not use block comments.'
2287
+ StyleGuide: '#no-block-comments'
2288
+ Enabled: true
2289
+ VersionAdded: '0.9'
2290
+ VersionChanged: '0.23'
2291
+
2292
+ Style/BlockDelimiters:
2293
+ Description: >-
2294
+ Avoid using {...} for multi-line blocks (multiline chaining is
2295
+ always ugly).
2296
+ Prefer {...} over do...end for single-line blocks.
2297
+ StyleGuide: '#single-line-blocks'
2298
+ Enabled: true
2299
+ VersionAdded: '0.30'
2300
+ VersionChanged: '0.35'
2301
+ EnforcedStyle: line_count_based
2302
+ SupportedStyles:
2303
+ # The `line_count_based` style enforces braces around single line blocks and
2304
+ # do..end around multi-line blocks.
2305
+ - line_count_based
2306
+ # The `semantic` style enforces braces around functional blocks, where the
2307
+ # primary purpose of the block is to return a value and do..end for
2308
+ # multi-line procedural blocks, where the primary purpose of the block is
2309
+ # its side-effects. Single-line procedural blocks may only use do-end,
2310
+ # unless AllowBracesOnProceduralOneLiners has a truthy value (see below).
2311
+ #
2312
+ # This looks at the usage of a block's method to determine its type (e.g. is
2313
+ # the result of a `map` assigned to a variable or passed to another
2314
+ # method) but exceptions are permitted in the `ProceduralMethods`,
2315
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
2316
+ - semantic
2317
+ # The `braces_for_chaining` style enforces braces around single line blocks
2318
+ # and do..end around multi-line blocks, except for multi-line blocks whose
2319
+ # return value is being chained with another method (in which case braces
2320
+ # are enforced).
2321
+ - braces_for_chaining
2322
+ # The `always_braces` style always enforces braces.
2323
+ - always_braces
2324
+ ProceduralMethods:
2325
+ # Methods that are known to be procedural in nature but look functional from
2326
+ # their usage, e.g.
2327
+ #
2328
+ # time = Benchmark.realtime do
2329
+ # foo.bar
2330
+ # end
2331
+ #
2332
+ # Here, the return value of the block is discarded but the return value of
2333
+ # `Benchmark.realtime` is used.
2334
+ - benchmark
2335
+ - bm
2336
+ - bmbm
2337
+ - create
2338
+ - each_with_object
2339
+ - measure
2340
+ - new
2341
+ - realtime
2342
+ - tap
2343
+ - with_object
2344
+ FunctionalMethods:
2345
+ # Methods that are known to be functional in nature but look procedural from
2346
+ # their usage, e.g.
2347
+ #
2348
+ # let(:foo) { Foo.new }
2349
+ #
2350
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
2351
+ # doesn't appear to be used from the return value of `let`.
2352
+ - let
2353
+ - let!
2354
+ - subject
2355
+ - watch
2356
+ IgnoredMethods:
2357
+ # Methods that can be either procedural or functional and cannot be
2358
+ # categorised from their usage alone, e.g.
2359
+ #
2360
+ # foo = lambda do |x|
2361
+ # puts "Hello, #{x}"
2362
+ # end
2363
+ #
2364
+ # foo = lambda do |x|
2365
+ # x * 100
2366
+ # end
2367
+ #
2368
+ # Here, it is impossible to tell from the return value of `lambda` whether
2369
+ # the inner block's return value is significant.
2370
+ - lambda
2371
+ - proc
2372
+ - it
2373
+ # The AllowBracesOnProceduralOneLiners option is ignored unless the
2374
+ # EnforcedStyle is set to `semantic`. If so:
2375
+ #
2376
+ # If AllowBracesOnProceduralOneLiners is unspecified, or set to any
2377
+ # falsey value, then semantic purity is maintained, so one-line
2378
+ # procedural blocks must use do-end, not braces.
2379
+ #
2380
+ # # bad
2381
+ # collection.each { |element| puts element }
2382
+ #
2383
+ # # good
2384
+ # collection.each do |element| puts element end
2385
+ #
2386
+ # If AllowBracesOnProceduralOneLiners is set to any truthy value,
2387
+ # then one-line procedural blocks may use either style.
2388
+ #
2389
+ # # good
2390
+ # collection.each { |element| puts element }
2391
+ #
2392
+ # # also good
2393
+ # collection.each do |element| puts element end
2394
+ AllowBracesOnProceduralOneLiners: false
2395
+ # The BracesRequiredMethods overrides all other configurations except
2396
+ # IgnoredMethods. It can be used to enforce that all blocks for specific
2397
+ # methods use braces. For example, you can use this to enforce Sorbet
2398
+ # signatures use braces even when the rest of your codebase enforces
2399
+ # the `line_count_based` style.
2400
+ BracesRequiredMethods: []
2401
+
2402
+ Style/CaseEquality:
2403
+ Description: 'Avoid explicit use of the case equality operator(===).'
2404
+ StyleGuide: '#no-case-equality'
2405
+ Enabled: true
2406
+ VersionAdded: '0.9'
2407
+
2408
+ Style/CharacterLiteral:
2409
+ Description: 'Checks for uses of character literals.'
2410
+ StyleGuide: '#no-character-literals'
2411
+ Enabled: true
2412
+ VersionAdded: '0.9'
2413
+
2414
+ Style/ClassAndModuleChildren:
2415
+ Description: 'Checks style of children classes and modules.'
2416
+ StyleGuide: '#namespace-definition'
2417
+ # Moving from compact to nested children requires knowledge of whether the
2418
+ # outer parent is a module or a class. Moving from nested to compact requires
2419
+ # verification that the outer parent is defined elsewhere. Rubocop does not
2420
+ # have the knowledge to perform either operation safely and thus requires
2421
+ # manual oversight.
2422
+ SafeAutoCorrect: false
2423
+ AutoCorrect: false
2424
+ Enabled: true
2425
+ VersionAdded: '0.19'
2426
+ #
2427
+ # Basically there are two different styles:
2428
+ #
2429
+ # `nested` - have each child on a separate line
2430
+ # class Foo
2431
+ # class Bar
2432
+ # end
2433
+ # end
2434
+ #
2435
+ # `compact` - combine definitions as much as possible
2436
+ # class Foo::Bar
2437
+ # end
2438
+ #
2439
+ # The compact style is only forced, for classes or modules with one child.
2440
+ EnforcedStyle: nested
2441
+ SupportedStyles:
2442
+ - nested
2443
+ - compact
2444
+
2445
+ Style/ClassCheck:
2446
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
2447
+ Enabled: true
2448
+ VersionAdded: '0.24'
2449
+ EnforcedStyle: is_a?
2450
+ SupportedStyles:
2451
+ - is_a?
2452
+ - kind_of?
2453
+
2454
+ Style/ClassMethods:
2455
+ Description: 'Use self when defining module/class methods.'
2456
+ StyleGuide: '#def-self-class-methods'
2457
+ Enabled: true
2458
+ VersionAdded: '0.9'
2459
+ VersionChanged: '0.20'
2460
+
2461
+ Style/ClassVars:
2462
+ Description: 'Avoid the use of class variables.'
2463
+ StyleGuide: '#no-class-vars'
2464
+ Enabled: true
2465
+ VersionAdded: '0.13'
2466
+
2467
+ # Align with the style guide.
2468
+ Style/CollectionMethods:
2469
+ Description: 'Preferred collection methods.'
2470
+ StyleGuide: '#map-find-select-reduce-include-size'
2471
+ Enabled: false
2472
+ VersionAdded: '0.9'
2473
+ VersionChanged: '0.27'
2474
+ Safe: false
2475
+ # Mapping from undesired method to desired method
2476
+ # e.g. to use `detect` over `find`:
2477
+ #
2478
+ # Style/CollectionMethods:
2479
+ # PreferredMethods:
2480
+ # find: detect
2481
+ PreferredMethods:
2482
+ collect: 'map'
2483
+ collect!: 'map!'
2484
+ inject: 'reduce'
2485
+ detect: 'find'
2486
+ find_all: 'select'
2487
+ member?: 'include?'
2488
+
2489
+ Style/ColonMethodCall:
2490
+ Description: 'Do not use :: for method call.'
2491
+ StyleGuide: '#double-colons'
2492
+ Enabled: true
2493
+ VersionAdded: '0.9'
2494
+
2495
+ Style/ColonMethodDefinition:
2496
+ Description: 'Do not use :: for defining class methods.'
2497
+ StyleGuide: '#colon-method-definition'
2498
+ Enabled: true
2499
+ VersionAdded: '0.52'
2500
+
2501
+ Style/CommandLiteral:
2502
+ Description: 'Use `` or %x around command literals.'
2503
+ StyleGuide: '#percent-x'
2504
+ Enabled: true
2505
+ VersionAdded: '0.30'
2506
+ EnforcedStyle: backticks
2507
+ # backticks: Always use backticks.
2508
+ # percent_x: Always use `%x`.
2509
+ # mixed: Use backticks on single-line commands, and `%x` on multi-line commands.
2510
+ SupportedStyles:
2511
+ - backticks
2512
+ - percent_x
2513
+ - mixed
2514
+ # If `false`, the cop will always recommend using `%x` if one or more backticks
2515
+ # are found in the command string.
2516
+ AllowInnerBackticks: false
2517
+
2518
+ # Checks formatting of special comments
2519
+ Style/CommentAnnotation:
2520
+ Description: >-
2521
+ Checks formatting of special comments
2522
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
2523
+ StyleGuide: '#annotate-keywords'
2524
+ Enabled: true
2525
+ VersionAdded: '0.10'
2526
+ VersionChanged: '0.31'
2527
+ Keywords:
2528
+ - TODO
2529
+ - FIXME
2530
+ - OPTIMIZE
2531
+ - HACK
2532
+ - REVIEW
2533
+
2534
+ Style/CommentedKeyword:
2535
+ Description: 'Do not place comments on the same line as certain keywords.'
2536
+ Enabled: true
2537
+ VersionAdded: '0.51'
2538
+
2539
+ Style/ConditionalAssignment:
2540
+ Description: >-
2541
+ Use the return value of `if` and `case` statements for
2542
+ assignment to a variable and variable comparison instead
2543
+ of assigning that variable inside of each branch.
2544
+ Enabled: true
2545
+ VersionAdded: '0.36'
2546
+ VersionChanged: '0.47'
2547
+ EnforcedStyle: assign_to_condition
2548
+ SupportedStyles:
2549
+ - assign_to_condition
2550
+ - assign_inside_condition
2551
+ # When configured to `assign_to_condition`, `SingleLineConditionsOnly`
2552
+ # will only register an offense when all branches of a condition are
2553
+ # a single line.
2554
+ # When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
2555
+ # will only register an offense for assignment to a condition that has
2556
+ # at least one multiline branch.
2557
+ SingleLineConditionsOnly: true
2558
+ IncludeTernaryExpressions: true
2559
+
2560
+ Style/ConstantVisibility:
2561
+ Description: >-
2562
+ Check that class- and module constants have
2563
+ visibility declarations.
2564
+ Enabled: false
2565
+ VersionAdded: '0.66'
2566
+
2567
+ # Checks that you have put a copyright in a comment before any code.
2568
+ #
2569
+ # You can override the default Notice in your .rubocop.yml file.
2570
+ #
2571
+ # In order to use autocorrect, you must supply a value for the
2572
+ # `AutocorrectNotice` key that matches the regexp Notice. A blank
2573
+ # `AutocorrectNotice` will cause an error during autocorrect.
2574
+ #
2575
+ # Autocorrect will add a copyright notice in a comment at the top
2576
+ # of the file immediately after any shebang or encoding comments.
2577
+ #
2578
+ # Example rubocop.yml:
2579
+ #
2580
+ # Style/Copyright:
2581
+ # Enabled: true
2582
+ # Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
2583
+ # AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
2584
+ #
2585
+ Style/Copyright:
2586
+ Description: 'Include a copyright notice in each file before any code.'
2587
+ Enabled: false
2588
+ VersionAdded: '0.30'
2589
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
2590
+ AutocorrectNotice: ''
2591
+
2592
+ Style/DateTime:
2593
+ Description: 'Use Time over DateTime.'
2594
+ StyleGuide: '#date--time'
2595
+ Enabled: false
2596
+ VersionAdded: '0.51'
2597
+ VersionChanged: '0.59'
2598
+ AllowCoercion: false
2599
+
2600
+ Style/DefWithParentheses:
2601
+ Description: 'Use def with parentheses when there are arguments.'
2602
+ StyleGuide: '#method-parens'
2603
+ Enabled: true
2604
+ VersionAdded: '0.9'
2605
+ VersionChanged: '0.12'
2606
+
2607
+ Style/Dir:
2608
+ Description: >-
2609
+ Use the `__dir__` method to retrieve the canonicalized
2610
+ absolute path to the current file.
2611
+ Enabled: true
2612
+ VersionAdded: '0.50'
2613
+
2614
+ Style/Documentation:
2615
+ Description: 'Document classes and non-namespace modules.'
2616
+ Enabled: true
2617
+ VersionAdded: '0.9'
2618
+ Exclude:
2619
+ - 'spec/**/*'
2620
+ - 'test/**/*'
2621
+
2622
+ Style/DocumentationMethod:
2623
+ Description: 'Checks for missing documentation comment for public methods.'
2624
+ Enabled: false
2625
+ VersionAdded: '0.43'
2626
+ Exclude:
2627
+ - 'spec/**/*'
2628
+ - 'test/**/*'
2629
+ RequireForNonPublicMethods: false
2630
+
2631
+ Style/DoubleCopDisableDirective:
2632
+ Description: 'Checks for double rubocop:disable comments on a single line.'
2633
+ Enabled: true
2634
+ VersionAdded: '0.73'
2635
+
2636
+ Style/DoubleNegation:
2637
+ Description: 'Checks for uses of double negation (!!).'
2638
+ StyleGuide: '#no-bang-bang'
2639
+ Enabled: true
2640
+ VersionAdded: '0.19'
2641
+
2642
+ Style/EachForSimpleLoop:
2643
+ Description: >-
2644
+ Use `Integer#times` for a simple loop which iterates a fixed
2645
+ number of times.
2646
+ Enabled: true
2647
+ VersionAdded: '0.41'
2648
+
2649
+ Style/EachWithObject:
2650
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
2651
+ Enabled: true
2652
+ VersionAdded: '0.22'
2653
+ VersionChanged: '0.42'
2654
+
2655
+ Style/EmptyBlockParameter:
2656
+ Description: 'Omit pipes for empty block parameters.'
2657
+ Enabled: true
2658
+ VersionAdded: '0.52'
2659
+
2660
+ Style/EmptyCaseCondition:
2661
+ Description: 'Avoid empty condition in case statements.'
2662
+ Enabled: true
2663
+ VersionAdded: '0.40'
2664
+
2665
+ Style/EmptyElse:
2666
+ Description: 'Avoid empty else-clauses.'
2667
+ Enabled: true
2668
+ VersionAdded: '0.28'
2669
+ VersionChanged: '0.32'
2670
+ EnforcedStyle: both
2671
+ # empty - warn only on empty `else`
2672
+ # nil - warn on `else` with nil in it
2673
+ # both - warn on empty `else` and `else` with `nil` in it
2674
+ SupportedStyles:
2675
+ - empty
2676
+ - nil
2677
+ - both
2678
+
2679
+ Style/EmptyLambdaParameter:
2680
+ Description: 'Omit parens for empty lambda parameters.'
2681
+ Enabled: true
2682
+ VersionAdded: '0.52'
2683
+
2684
+ Style/EmptyLiteral:
2685
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
2686
+ StyleGuide: '#literal-array-hash'
2687
+ Enabled: true
2688
+ VersionAdded: '0.9'
2689
+ VersionChanged: '0.12'
2690
+
2691
+ Style/EmptyMethod:
2692
+ Description: 'Checks the formatting of empty method definitions.'
2693
+ StyleGuide: '#no-single-line-methods'
2694
+ Enabled: true
2695
+ VersionAdded: '0.46'
2696
+ EnforcedStyle: compact
2697
+ SupportedStyles:
2698
+ - compact
2699
+ - expanded
2700
+
2701
+ Style/Encoding:
2702
+ Description: 'Use UTF-8 as the source file encoding.'
2703
+ StyleGuide: '#utf-8'
2704
+ Enabled: true
2705
+ VersionAdded: '0.9'
2706
+ VersionChanged: '0.50'
2707
+
2708
+ Style/EndBlock:
2709
+ Description: 'Avoid the use of END blocks.'
2710
+ StyleGuide: '#no-END-blocks'
2711
+ Enabled: true
2712
+ VersionAdded: '0.9'
2713
+ VersionChanged: '0.81'
2714
+
2715
+ Style/EvalWithLocation:
2716
+ Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
2717
+ Enabled: true
2718
+ VersionAdded: '0.52'
2719
+
2720
+ Style/EvenOdd:
2721
+ Description: 'Favor the use of `Integer#even?` && `Integer#odd?`.'
2722
+ StyleGuide: '#predicate-methods'
2723
+ Enabled: true
2724
+ VersionAdded: '0.12'
2725
+ VersionChanged: '0.29'
2726
+
2727
+ Style/ExpandPathArguments:
2728
+ Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`."
2729
+ Enabled: true
2730
+ VersionAdded: '0.53'
2731
+
2732
+ Style/FloatDivision:
2733
+ Description: 'For performing float division, coerce one side only.'
2734
+ StyleGuide: '#float-division'
2735
+ Reference: 'https://github.com/rubocop-hq/ruby-style-guide/issues/628'
2736
+ Enabled: true
2737
+ VersionAdded: '0.72'
2738
+ EnforcedStyle: single_coerce
2739
+ SupportedStyles:
2740
+ - left_coerce
2741
+ - right_coerce
2742
+ - single_coerce
2743
+ - fdiv
2744
+
2745
+ Style/For:
2746
+ Description: 'Checks use of for or each in multiline loops.'
2747
+ StyleGuide: '#no-for-loops'
2748
+ Enabled: true
2749
+ VersionAdded: '0.13'
2750
+ VersionChanged: '0.59'
2751
+ EnforcedStyle: each
2752
+ SupportedStyles:
2753
+ - each
2754
+ - for
2755
+
2756
+ Style/FormatString:
2757
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
2758
+ StyleGuide: '#sprintf'
2759
+ Enabled: true
2760
+ VersionAdded: '0.19'
2761
+ VersionChanged: '0.49'
2762
+ EnforcedStyle: format
2763
+ SupportedStyles:
2764
+ - format
2765
+ - sprintf
2766
+ - percent
2767
+
2768
+ Style/FormatStringToken:
2769
+ Description: 'Use a consistent style for format string tokens.'
2770
+ Enabled: true
2771
+ EnforcedStyle: annotated
2772
+ SupportedStyles:
2773
+ # Prefer tokens which contain a sprintf like type annotation like
2774
+ # `%<name>s`, `%<age>d`, `%<score>f`
2775
+ - annotated
2776
+ # Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
2777
+ - template
2778
+ - unannotated
2779
+ VersionAdded: '0.49'
2780
+ VersionChanged: '0.75'
2781
+
2782
+ Style/FrozenStringLiteralComment:
2783
+ Description: >-
2784
+ Add the frozen_string_literal comment to the top of files
2785
+ to help transition to frozen string literals by default.
2786
+ Enabled: true
2787
+ VersionAdded: '0.36'
2788
+ VersionChanged: '0.79'
2789
+ EnforcedStyle: always
2790
+ SupportedStyles:
2791
+ # `always` will always add the frozen string literal comment to a file
2792
+ # regardless of the Ruby version or if `freeze` or `<<` are called on a
2793
+ # string literal. If you run code against multiple versions of Ruby, it is
2794
+ # possible that this will create errors in Ruby 2.3.0+.
2795
+ - always
2796
+ # `always_true` will add the frozen string literal comment to a file,
2797
+ # similarly to the `always` style, but will also change any disabled
2798
+ # comments (e.g. `# frozen_string_literal: false`) to be enabled.
2799
+ - always_true
2800
+ # `never` will enforce that the frozen string literal comment does not
2801
+ # exist in a file.
2802
+ - never
2803
+ Safe: false
2804
+
2805
+ Style/GlobalVars:
2806
+ Description: 'Do not introduce global variables.'
2807
+ StyleGuide: '#instance-vars'
2808
+ Reference: 'https://www.zenspider.com/ruby/quickref.html'
2809
+ Enabled: true
2810
+ VersionAdded: '0.13'
2811
+ # Built-in global variables are allowed by default.
2812
+ AllowedVariables: []
2813
+
2814
+ Style/GuardClause:
2815
+ Description: 'Check for conditionals that can be replaced with guard clauses.'
2816
+ StyleGuide: '#no-nested-conditionals'
2817
+ Enabled: true
2818
+ VersionAdded: '0.20'
2819
+ VersionChanged: '0.22'
2820
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
2821
+ # needs to have to trigger this cop
2822
+ MinBodyLength: 1
2823
+
2824
+ Style/HashEachMethods:
2825
+ Description: 'Use Hash#each_key and Hash#each_value.'
2826
+ StyleGuide: '#hash-each'
2827
+ Enabled: pending
2828
+ VersionAdded: '0.80'
2829
+ Safe: false
2830
+
2831
+ Style/HashSyntax:
2832
+ Description: >-
2833
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
2834
+ { :a => 1, :b => 2 }.
2835
+ StyleGuide: '#hash-literals'
2836
+ Enabled: true
2837
+ VersionAdded: '0.9'
2838
+ VersionChanged: '0.43'
2839
+ EnforcedStyle: ruby19
2840
+ SupportedStyles:
2841
+ # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
2842
+ - ruby19
2843
+ # checks for hash rocket syntax for all hashes
2844
+ - hash_rockets
2845
+ # forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
2846
+ - no_mixed_keys
2847
+ # enforces both ruby19 and no_mixed_keys styles
2848
+ - ruby19_no_mixed_keys
2849
+ # Force hashes that have a symbol value to use hash rockets
2850
+ UseHashRocketsWithSymbolValues: false
2851
+ # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
2852
+ PreferHashRocketsForNonAlnumEndingSymbols: false
2853
+
2854
+ Style/HashTransformKeys:
2855
+ Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
2856
+ Enabled: 'pending'
2857
+ VersionAdded: '0.80'
2858
+ Safe: false
2859
+
2860
+ Style/HashTransformValues:
2861
+ Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
2862
+ Enabled: 'pending'
2863
+ VersionAdded: '0.80'
2864
+ Safe: false
2865
+
2866
+ Style/IdenticalConditionalBranches:
2867
+ Description: >-
2868
+ Checks that conditional statements do not have an identical
2869
+ line at the end of each branch, which can validly be moved
2870
+ out of the conditional.
2871
+ Enabled: true
2872
+ VersionAdded: '0.36'
2873
+
2874
+ Style/IfInsideElse:
2875
+ Description: 'Finds if nodes inside else, which can be converted to elsif.'
2876
+ Enabled: true
2877
+ AllowIfModifier: false
2878
+ VersionAdded: '0.36'
2879
+
2880
+ Style/IfUnlessModifier:
2881
+ Description: >-
2882
+ Favor modifier if/unless usage when you have a
2883
+ single-line body.
2884
+ StyleGuide: '#if-as-a-modifier'
2885
+ Enabled: true
2886
+ VersionAdded: '0.9'
2887
+ VersionChanged: '0.30'
2888
+
2889
+ Style/IfUnlessModifierOfIfUnless:
2890
+ Description: >-
2891
+ Avoid modifier if/unless usage on conditionals.
2892
+ Enabled: true
2893
+ VersionAdded: '0.39'
2894
+
2895
+ Style/IfWithSemicolon:
2896
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
2897
+ StyleGuide: '#no-semicolon-ifs'
2898
+ Enabled: true
2899
+ VersionAdded: '0.9'
2900
+
2901
+ Style/ImplicitRuntimeError:
2902
+ Description: >-
2903
+ Use `raise` or `fail` with an explicit exception class and
2904
+ message, rather than just a message.
2905
+ Enabled: false
2906
+ VersionAdded: '0.41'
2907
+
2908
+ Style/InfiniteLoop:
2909
+ Description: 'Use Kernel#loop for infinite loops.'
2910
+ StyleGuide: '#infinite-loop'
2911
+ Enabled: true
2912
+ VersionAdded: '0.26'
2913
+ VersionChanged: '0.61'
2914
+ SafeAutoCorrect: true
2915
+
2916
+ Style/InlineComment:
2917
+ Description: 'Avoid trailing inline comments.'
2918
+ Enabled: false
2919
+ VersionAdded: '0.23'
2920
+
2921
+ Style/InverseMethods:
2922
+ Description: >-
2923
+ Use the inverse method instead of `!.method`
2924
+ if an inverse method is defined.
2925
+ Enabled: true
2926
+ Safe: false
2927
+ VersionAdded: '0.48'
2928
+ # `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
2929
+ # The relationship of inverse methods only needs to be defined in one direction.
2930
+ # Keys and values both need to be defined as symbols.
2931
+ InverseMethods:
2932
+ :any?: :none?
2933
+ :even?: :odd?
2934
+ :==: :!=
2935
+ :=~: :!~
2936
+ :<: :>=
2937
+ :>: :<=
2938
+ # `ActiveSupport` defines some common inverse methods. They are listed below,
2939
+ # and not enabled by default.
2940
+ #:present?: :blank?,
2941
+ #:include?: :exclude?
2942
+ # `InverseBlocks` are methods that are inverted by inverting the return
2943
+ # of the block that is passed to the method
2944
+ InverseBlocks:
2945
+ :select: :reject
2946
+ :select!: :reject!
2947
+
2948
+ Style/IpAddresses:
2949
+ Description: "Don't include literal IP addresses in code."
2950
+ Enabled: false
2951
+ VersionAdded: '0.58'
2952
+ VersionChanged: '0.77'
2953
+ # Allow addresses to be permitted
2954
+ AllowedAddresses:
2955
+ - "::"
2956
+ # :: is a valid IPv6 address, but could potentially be legitimately in code
2957
+
2958
+ Style/Lambda:
2959
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
2960
+ StyleGuide: '#lambda-multi-line'
2961
+ Enabled: true
2962
+ VersionAdded: '0.9'
2963
+ VersionChanged: '0.40'
2964
+ EnforcedStyle: line_count_dependent
2965
+ SupportedStyles:
2966
+ - line_count_dependent
2967
+ - lambda
2968
+ - literal
2969
+
2970
+ Style/LambdaCall:
2971
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
2972
+ StyleGuide: '#proc-call'
2973
+ Enabled: true
2974
+ VersionAdded: '0.13'
2975
+ VersionChanged: '0.14'
2976
+ EnforcedStyle: call
2977
+ SupportedStyles:
2978
+ - call
2979
+ - braces
2980
+
2981
+ Style/LineEndConcatenation:
2982
+ Description: >-
2983
+ Use \ instead of + or << to concatenate two string literals at
2984
+ line end.
2985
+ Enabled: true
2986
+ SafeAutoCorrect: false
2987
+ VersionAdded: '0.18'
2988
+ VersionChanged: '0.64'
2989
+
2990
+ Style/MethodCallWithArgsParentheses:
2991
+ Description: 'Use parentheses for method calls with arguments.'
2992
+ StyleGuide: '#method-invocation-parens'
2993
+ Enabled: false
2994
+ VersionAdded: '0.47'
2995
+ VersionChanged: '0.61'
2996
+ IgnoreMacros: true
2997
+ IgnoredMethods: []
2998
+ IgnoredPatterns: []
2999
+ IncludedMacros: []
3000
+ AllowParenthesesInMultilineCall: false
3001
+ AllowParenthesesInChaining: false
3002
+ AllowParenthesesInCamelCaseMethod: false
3003
+ EnforcedStyle: require_parentheses
3004
+ SupportedStyles:
3005
+ - require_parentheses
3006
+ - omit_parentheses
3007
+
3008
+ Style/MethodCallWithoutArgsParentheses:
3009
+ Description: 'Do not use parentheses for method calls with no arguments.'
3010
+ StyleGuide: '#method-invocation-parens'
3011
+ Enabled: true
3012
+ IgnoredMethods: []
3013
+ VersionAdded: '0.47'
3014
+ VersionChanged: '0.55'
3015
+
3016
+ Style/MethodCalledOnDoEndBlock:
3017
+ Description: 'Avoid chaining a method call on a do...end block.'
3018
+ StyleGuide: '#single-line-blocks'
3019
+ Enabled: false
3020
+ VersionAdded: '0.14'
3021
+
3022
+ Style/MethodDefParentheses:
3023
+ Description: >-
3024
+ Checks if the method definitions have or don't have
3025
+ parentheses.
3026
+ StyleGuide: '#method-parens'
3027
+ Enabled: true
3028
+ VersionAdded: '0.16'
3029
+ VersionChanged: '0.35'
3030
+ EnforcedStyle: require_parentheses
3031
+ SupportedStyles:
3032
+ - require_parentheses
3033
+ - require_no_parentheses
3034
+ - require_no_parentheses_except_multiline
3035
+
3036
+ Style/MethodMissingSuper:
3037
+ Description: Checks for `method_missing` to call `super`.
3038
+ StyleGuide: '#no-method-missing'
3039
+ Enabled: true
3040
+ VersionAdded: '0.56'
3041
+
3042
+ Style/MinMax:
3043
+ Description: >-
3044
+ Use `Enumerable#minmax` instead of `Enumerable#min`
3045
+ and `Enumerable#max` in conjunction.
3046
+ Enabled: true
3047
+ VersionAdded: '0.50'
3048
+
3049
+ Style/MissingElse:
3050
+ Description: >-
3051
+ Require if/case expressions to have an else branches.
3052
+ If enabled, it is recommended that
3053
+ Style/UnlessElse and Style/EmptyElse be enabled.
3054
+ This will conflict with Style/EmptyElse if
3055
+ Style/EmptyElse is configured to style "both".
3056
+ Enabled: false
3057
+ VersionAdded: '0.30'
3058
+ VersionChanged: '0.38'
3059
+ EnforcedStyle: both
3060
+ SupportedStyles:
3061
+ # if - warn when an if expression is missing an else branch
3062
+ # case - warn when a case expression is missing an else branch
3063
+ # both - warn when an if or case expression is missing an else branch
3064
+ - if
3065
+ - case
3066
+ - both
3067
+
3068
+ Style/MissingRespondToMissing:
3069
+ Description: >-
3070
+ Checks if `method_missing` is implemented
3071
+ without implementing `respond_to_missing`.
3072
+ StyleGuide: '#no-method-missing'
3073
+ Enabled: true
3074
+ VersionAdded: '0.56'
3075
+
3076
+ Style/MixinGrouping:
3077
+ Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
3078
+ StyleGuide: '#mixin-grouping'
3079
+ Enabled: true
3080
+ VersionAdded: '0.48'
3081
+ VersionChanged: '0.49'
3082
+ EnforcedStyle: separated
3083
+ SupportedStyles:
3084
+ # separated: each mixed in module goes in a separate statement.
3085
+ # grouped: mixed in modules are grouped into a single statement.
3086
+ - separated
3087
+ - grouped
3088
+
3089
+ Style/MixinUsage:
3090
+ Description: 'Checks that `include`, `extend` and `prepend` exists at the top level.'
3091
+ Enabled: true
3092
+ VersionAdded: '0.51'
3093
+
3094
+ Style/ModuleFunction:
3095
+ Description: 'Checks for usage of `extend self` in modules.'
3096
+ StyleGuide: '#module-function'
3097
+ Enabled: true
3098
+ VersionAdded: '0.11'
3099
+ VersionChanged: '0.65'
3100
+ EnforcedStyle: module_function
3101
+ SupportedStyles:
3102
+ - module_function
3103
+ - extend_self
3104
+ - forbidden
3105
+ Autocorrect: false
3106
+ SafeAutoCorrect: false
3107
+
3108
+ Style/MultilineBlockChain:
3109
+ Description: 'Avoid multi-line chains of blocks.'
3110
+ StyleGuide: '#single-line-blocks'
3111
+ Enabled: true
3112
+ VersionAdded: '0.13'
3113
+
3114
+ Style/MultilineIfModifier:
3115
+ Description: 'Only use if/unless modifiers on single line statements.'
3116
+ StyleGuide: '#no-multiline-if-modifiers'
3117
+ Enabled: true
3118
+ VersionAdded: '0.45'
3119
+
3120
+ Style/MultilineIfThen:
3121
+ Description: 'Do not use then for multi-line if/unless.'
3122
+ StyleGuide: '#no-then'
3123
+ Enabled: true
3124
+ VersionAdded: '0.9'
3125
+ VersionChanged: '0.26'
3126
+
3127
+ Style/MultilineMemoization:
3128
+ Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
3129
+ Enabled: true
3130
+ VersionAdded: '0.44'
3131
+ VersionChanged: '0.48'
3132
+ EnforcedStyle: keyword
3133
+ SupportedStyles:
3134
+ - keyword
3135
+ - braces
3136
+
3137
+ Style/MultilineMethodSignature:
3138
+ Description: 'Avoid multi-line method signatures.'
3139
+ Enabled: false
3140
+ VersionAdded: '0.59'
3141
+
3142
+ Style/MultilineTernaryOperator:
3143
+ Description: >-
3144
+ Avoid multi-line ?: (the ternary operator);
3145
+ use if/unless instead.
3146
+ StyleGuide: '#no-multiline-ternary'
3147
+ Enabled: true
3148
+ VersionAdded: '0.9'
3149
+
3150
+ Style/MultilineWhenThen:
3151
+ Description: 'Do not use then for multi-line when statement.'
3152
+ StyleGuide: '#no-then'
3153
+ Enabled: true
3154
+ VersionAdded: '0.73'
3155
+
3156
+ Style/MultipleComparison:
3157
+ Description: >-
3158
+ Avoid comparing a variable with multiple items in a conditional,
3159
+ use Array#include? instead.
3160
+ Enabled: true
3161
+ VersionAdded: '0.49'
3162
+
3163
+ Style/MutableConstant:
3164
+ Description: 'Do not assign mutable objects to constants.'
3165
+ Enabled: true
3166
+ VersionAdded: '0.34'
3167
+ VersionChanged: '0.65'
3168
+ EnforcedStyle: literals
3169
+ SupportedStyles:
3170
+ # literals: freeze literals assigned to constants
3171
+ # strict: freeze all constants
3172
+ # Strict mode is considered an experimental feature. It has not been updated
3173
+ # with an exhaustive list of all methods that will produce frozen objects so
3174
+ # there is a decent chance of getting some false positives. Luckily, there is
3175
+ # no harm in freezing an already frozen object.
3176
+ - literals
3177
+ - strict
3178
+
3179
+ Style/NegatedIf:
3180
+ Description: >-
3181
+ Favor unless over if for negative conditions
3182
+ (or control flow or).
3183
+ StyleGuide: '#unless-for-negatives'
3184
+ Enabled: true
3185
+ VersionAdded: '0.20'
3186
+ VersionChanged: '0.48'
3187
+ EnforcedStyle: both
3188
+ SupportedStyles:
3189
+ # both: prefix and postfix negated `if` should both use `unless`
3190
+ # prefix: only use `unless` for negated `if` statements positioned before the body of the statement
3191
+ # postfix: only use `unless` for negated `if` statements positioned after the body of the statement
3192
+ - both
3193
+ - prefix
3194
+ - postfix
3195
+
3196
+ Style/NegatedUnless:
3197
+ Description: 'Favor if over unless for negative conditions.'
3198
+ StyleGuide: '#if-for-negatives'
3199
+ Enabled: true
3200
+ VersionAdded: '0.69'
3201
+ EnforcedStyle: both
3202
+ SupportedStyles:
3203
+ # both: prefix and postfix negated `unless` should both use `if`
3204
+ # prefix: only use `if` for negated `unless` statements positioned before the body of the statement
3205
+ # postfix: only use `if` for negated `unless` statements positioned after the body of the statement
3206
+ - both
3207
+ - prefix
3208
+ - postfix
3209
+
3210
+ Style/NegatedWhile:
3211
+ Description: 'Favor until over while for negative conditions.'
3212
+ StyleGuide: '#until-for-negatives'
3213
+ Enabled: true
3214
+ VersionAdded: '0.20'
3215
+
3216
+ Style/NestedModifier:
3217
+ Description: 'Avoid using nested modifiers.'
3218
+ StyleGuide: '#no-nested-modifiers'
3219
+ Enabled: true
3220
+ VersionAdded: '0.35'
3221
+
3222
+ Style/NestedParenthesizedCalls:
3223
+ Description: >-
3224
+ Parenthesize method calls which are nested inside the
3225
+ argument list of another parenthesized method call.
3226
+ Enabled: true
3227
+ VersionAdded: '0.36'
3228
+ VersionChanged: '0.77'
3229
+ AllowedMethods:
3230
+ - be
3231
+ - be_a
3232
+ - be_an
3233
+ - be_between
3234
+ - be_falsey
3235
+ - be_kind_of
3236
+ - be_instance_of
3237
+ - be_truthy
3238
+ - be_within
3239
+ - eq
3240
+ - eql
3241
+ - end_with
3242
+ - include
3243
+ - match
3244
+ - raise_error
3245
+ - respond_to
3246
+ - start_with
3247
+
3248
+ Style/NestedTernaryOperator:
3249
+ Description: 'Use one expression per branch in a ternary operator.'
3250
+ StyleGuide: '#no-nested-ternary'
3251
+ Enabled: true
3252
+ VersionAdded: '0.9'
3253
+
3254
+ Style/Next:
3255
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
3256
+ StyleGuide: '#no-nested-conditionals'
3257
+ Enabled: true
3258
+ VersionAdded: '0.22'
3259
+ VersionChanged: '0.35'
3260
+ # With `always` all conditions at the end of an iteration needs to be
3261
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
3262
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
3263
+ EnforcedStyle: skip_modifier_ifs
3264
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
3265
+ # needs to have to trigger this cop
3266
+ MinBodyLength: 3
3267
+ SupportedStyles:
3268
+ - skip_modifier_ifs
3269
+ - always
3270
+
3271
+ Style/NilComparison:
3272
+ Description: 'Prefer x.nil? to x == nil.'
3273
+ StyleGuide: '#predicate-methods'
3274
+ Enabled: true
3275
+ VersionAdded: '0.12'
3276
+ VersionChanged: '0.59'
3277
+ EnforcedStyle: predicate
3278
+ SupportedStyles:
3279
+ - predicate
3280
+ - comparison
3281
+
3282
+ Style/NonNilCheck:
3283
+ Description: 'Checks for redundant nil checks.'
3284
+ StyleGuide: '#no-non-nil-checks'
3285
+ Enabled: true
3286
+ VersionAdded: '0.20'
3287
+ VersionChanged: '0.22'
3288
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
3289
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
3290
+ # **usually** OK, but might change behavior.
3291
+ #
3292
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
3293
+ # offenses for `!x.nil?` and does no changes that might change behavior.
3294
+ IncludeSemanticChanges: false
3295
+
3296
+ Style/Not:
3297
+ Description: 'Use ! instead of not.'
3298
+ StyleGuide: '#bang-not-not'
3299
+ Enabled: true
3300
+ VersionAdded: '0.9'
3301
+ VersionChanged: '0.20'
3302
+
3303
+ Style/NumericLiteralPrefix:
3304
+ Description: 'Use smallcase prefixes for numeric literals.'
3305
+ StyleGuide: '#numeric-literal-prefixes'
3306
+ Enabled: true
3307
+ VersionAdded: '0.41'
3308
+ EnforcedOctalStyle: zero_with_o
3309
+ SupportedOctalStyles:
3310
+ - zero_with_o
3311
+ - zero_only
3312
+
3313
+
3314
+ Style/NumericLiterals:
3315
+ Description: >-
3316
+ Add underscores to large numeric literals to improve their
3317
+ readability.
3318
+ StyleGuide: '#underscores-in-numerics'
3319
+ Enabled: true
3320
+ VersionAdded: '0.9'
3321
+ VersionChanged: '0.48'
3322
+ MinDigits: 5
3323
+ Strict: false
3324
+
3325
+ Style/NumericPredicate:
3326
+ Description: >-
3327
+ Checks for the use of predicate- or comparison methods for
3328
+ numeric comparisons.
3329
+ StyleGuide: '#predicate-methods'
3330
+ Safe: false
3331
+ # This will change to a new method call which isn't guaranteed to be on the
3332
+ # object. Switching these methods has to be done with knowledge of the types
3333
+ # of the variables which rubocop doesn't have.
3334
+ SafeAutoCorrect: false
3335
+ AutoCorrect: false
3336
+ Enabled: true
3337
+ VersionAdded: '0.42'
3338
+ VersionChanged: '0.59'
3339
+ EnforcedStyle: predicate
3340
+ SupportedStyles:
3341
+ - predicate
3342
+ - comparison
3343
+ IgnoredMethods: []
3344
+ # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
3345
+ # false positives.
3346
+ Exclude:
3347
+ - 'spec/**/*'
3348
+
3349
+ Style/OneLineConditional:
3350
+ Description: >-
3351
+ Favor the ternary operator(?:) over
3352
+ if/then/else/end constructs.
3353
+ StyleGuide: '#ternary-operator'
3354
+ Enabled: true
3355
+ VersionAdded: '0.9'
3356
+ VersionChanged: '0.38'
3357
+
3358
+ Style/OptionHash:
3359
+ Description: "Don't use option hashes when you can use keyword arguments."
3360
+ Enabled: false
3361
+ VersionAdded: '0.33'
3362
+ VersionChanged: '0.34'
3363
+ # A list of parameter names that will be flagged by this cop.
3364
+ SuspiciousParamNames:
3365
+ - options
3366
+ - opts
3367
+ - args
3368
+ - params
3369
+ - parameters
3370
+
3371
+ Style/OptionalArguments:
3372
+ Description: >-
3373
+ Checks for optional arguments that do not appear at the end
3374
+ of the argument list.
3375
+ StyleGuide: '#optional-arguments'
3376
+ Enabled: true
3377
+ VersionAdded: '0.33'
3378
+
3379
+ Style/OrAssignment:
3380
+ Description: 'Recommend usage of double pipe equals (||=) where applicable.'
3381
+ StyleGuide: '#double-pipe-for-uninit'
3382
+ Enabled: true
3383
+ VersionAdded: '0.50'
3384
+
3385
+ Style/ParallelAssignment:
3386
+ Description: >-
3387
+ Check for simple usages of parallel assignment.
3388
+ It will only warn when the number of variables
3389
+ matches on both sides of the assignment.
3390
+ StyleGuide: '#parallel-assignment'
3391
+ Enabled: true
3392
+ VersionAdded: '0.32'
3393
+
3394
+ Style/ParenthesesAroundCondition:
3395
+ Description: >-
3396
+ Don't use parentheses around the condition of an
3397
+ if/unless/while.
3398
+ StyleGuide: '#no-parens-around-condition'
3399
+ Enabled: true
3400
+ VersionAdded: '0.9'
3401
+ VersionChanged: '0.56'
3402
+ AllowSafeAssignment: true
3403
+ AllowInMultilineConditions: false
3404
+
3405
+ Style/PercentLiteralDelimiters:
3406
+ Description: 'Use `%`-literal delimiters consistently.'
3407
+ StyleGuide: '#percent-literal-braces'
3408
+ Enabled: true
3409
+ VersionAdded: '0.19'
3410
+ # Specify the default preferred delimiter for all types with the 'default' key
3411
+ # Override individual delimiters (even with default specified) by specifying
3412
+ # an individual key
3413
+ PreferredDelimiters:
3414
+ default: ()
3415
+ '%i': '[]'
3416
+ '%I': '[]'
3417
+ '%r': '{}'
3418
+ '%w': '[]'
3419
+ '%W': '[]'
3420
+ VersionChanged: '0.48.1'
3421
+
3422
+ Style/PercentQLiterals:
3423
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
3424
+ Enabled: true
3425
+ VersionAdded: '0.25'
3426
+ EnforcedStyle: lower_case_q
3427
+ SupportedStyles:
3428
+ - lower_case_q # Use `%q` when possible, `%Q` when necessary
3429
+ - upper_case_q # Always use `%Q`
3430
+
3431
+ Style/PerlBackrefs:
3432
+ Description: 'Avoid Perl-style regex back references.'
3433
+ StyleGuide: '#no-perl-regexp-last-matchers'
3434
+ Enabled: true
3435
+ VersionAdded: '0.13'
3436
+
3437
+ Style/PreferredHashMethods:
3438
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
3439
+ StyleGuide: '#hash-key'
3440
+ Enabled: true
3441
+ Safe: false
3442
+ VersionAdded: '0.41'
3443
+ VersionChanged: '0.70'
3444
+ EnforcedStyle: short
3445
+ SupportedStyles:
3446
+ - short
3447
+ - verbose
3448
+
3449
+ Style/Proc:
3450
+ Description: 'Use proc instead of Proc.new.'
3451
+ StyleGuide: '#proc'
3452
+ Enabled: true
3453
+ VersionAdded: '0.9'
3454
+ VersionChanged: '0.18'
3455
+
3456
+ Style/RaiseArgs:
3457
+ Description: 'Checks the arguments passed to raise/fail.'
3458
+ StyleGuide: '#exception-class-messages'
3459
+ Enabled: true
3460
+ VersionAdded: '0.14'
3461
+ VersionChanged: '0.40'
3462
+ EnforcedStyle: exploded
3463
+ SupportedStyles:
3464
+ - compact # raise Exception.new(msg)
3465
+ - exploded # raise Exception, msg
3466
+
3467
+ Style/RandomWithOffset:
3468
+ Description: >-
3469
+ Prefer to use ranges when generating random numbers instead of
3470
+ integers with offsets.
3471
+ StyleGuide: '#random-numbers'
3472
+ Enabled: true
3473
+ VersionAdded: '0.52'
3474
+
3475
+ Style/RedundantBegin:
3476
+ Description: "Don't use begin blocks when they are not needed."
3477
+ StyleGuide: '#begin-implicit'
3478
+ Enabled: true
3479
+ VersionAdded: '0.10'
3480
+ VersionChanged: '0.21'
3481
+
3482
+ Style/RedundantCapitalW:
3483
+ Description: 'Checks for %W when interpolation is not needed.'
3484
+ Enabled: true
3485
+ VersionAdded: '0.76'
3486
+
3487
+ Style/RedundantCondition:
3488
+ Description: 'Checks for unnecessary conditional expressions.'
3489
+ Enabled: true
3490
+ VersionAdded: '0.76'
3491
+
3492
+ Style/RedundantConditional:
3493
+ Description: "Don't return true/false from a conditional."
3494
+ Enabled: true
3495
+ VersionAdded: '0.50'
3496
+
3497
+ Style/RedundantException:
3498
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
3499
+ StyleGuide: '#no-explicit-runtimeerror'
3500
+ Enabled: true
3501
+ VersionAdded: '0.14'
3502
+ VersionChanged: '0.29'
3503
+
3504
+ Style/RedundantFreeze:
3505
+ Description: "Checks usages of Object#freeze on immutable objects."
3506
+ Enabled: true
3507
+ VersionAdded: '0.34'
3508
+ VersionChanged: '0.66'
3509
+
3510
+ Style/RedundantInterpolation:
3511
+ Description: 'Checks for strings that are just an interpolated expression.'
3512
+ Enabled: true
3513
+ VersionAdded: '0.76'
3514
+
3515
+ Style/RedundantParentheses:
3516
+ Description: "Checks for parentheses that seem not to serve any purpose."
3517
+ Enabled: true
3518
+ VersionAdded: '0.36'
3519
+
3520
+ Style/RedundantPercentQ:
3521
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
3522
+ StyleGuide: '#percent-q'
3523
+ Enabled: true
3524
+ VersionAdded: '0.76'
3525
+
3526
+ Style/RedundantReturn:
3527
+ Description: "Don't use return where it's not required."
3528
+ StyleGuide: '#no-explicit-return'
3529
+ Enabled: true
3530
+ VersionAdded: '0.10'
3531
+ VersionChanged: '0.14'
3532
+ # When `true` allows code like `return x, y`.
3533
+ AllowMultipleReturnValues: false
3534
+
3535
+ Style/RedundantSelf:
3536
+ Description: "Don't use self where it's not needed."
3537
+ StyleGuide: '#no-self-unless-required'
3538
+ Enabled: true
3539
+ VersionAdded: '0.10'
3540
+ VersionChanged: '0.13'
3541
+
3542
+ Style/RedundantSort:
3543
+ Description: >-
3544
+ Use `min` instead of `sort.first`,
3545
+ `max_by` instead of `sort_by...last`, etc.
3546
+ Enabled: true
3547
+ VersionAdded: '0.76'
3548
+
3549
+ Style/RedundantSortBy:
3550
+ Description: 'Use `sort` instead of `sort_by { |x| x }`.'
3551
+ Enabled: true
3552
+ VersionAdded: '0.36'
3553
+
3554
+ Style/RegexpLiteral:
3555
+ Description: 'Use / or %r around regular expressions.'
3556
+ StyleGuide: '#percent-r'
3557
+ Enabled: true
3558
+ VersionAdded: '0.9'
3559
+ VersionChanged: '0.30'
3560
+ EnforcedStyle: slashes
3561
+ # slashes: Always use slashes.
3562
+ # percent_r: Always use `%r`.
3563
+ # mixed: Use slashes on single-line regexes, and `%r` on multi-line regexes.
3564
+ SupportedStyles:
3565
+ - slashes
3566
+ - percent_r
3567
+ - mixed
3568
+ # If `false`, the cop will always recommend using `%r` if one or more slashes
3569
+ # are found in the regexp string.
3570
+ AllowInnerSlashes: false
3571
+
3572
+ Style/RescueModifier:
3573
+ Description: 'Avoid using rescue in its modifier form.'
3574
+ StyleGuide: '#no-rescue-modifiers'
3575
+ Enabled: true
3576
+ VersionAdded: '0.9'
3577
+ VersionChanged: '0.34'
3578
+
3579
+ Style/RescueStandardError:
3580
+ Description: 'Avoid rescuing without specifying an error class.'
3581
+ Enabled: true
3582
+ VersionAdded: '0.52'
3583
+ EnforcedStyle: explicit
3584
+ # implicit: Do not include the error class, `rescue`
3585
+ # explicit: Require an error class `rescue StandardError`
3586
+ SupportedStyles:
3587
+ - implicit
3588
+ - explicit
3589
+
3590
+ Style/ReturnNil:
3591
+ Description: 'Use return instead of return nil.'
3592
+ Enabled: false
3593
+ EnforcedStyle: return
3594
+ SupportedStyles:
3595
+ - return
3596
+ - return_nil
3597
+ VersionAdded: '0.50'
3598
+
3599
+ Style/SafeNavigation:
3600
+ Description: >-
3601
+ This cop transforms usages of a method call safeguarded by
3602
+ a check for the existence of the object to
3603
+ safe navigation (`&.`).
3604
+ Enabled: true
3605
+ VersionAdded: '0.43'
3606
+ VersionChanged: '0.77'
3607
+ # Safe navigation may cause a statement to start returning `nil` in addition
3608
+ # to whatever it used to return.
3609
+ ConvertCodeThatCanStartToReturnNil: false
3610
+ AllowedMethods:
3611
+ - present?
3612
+ - blank?
3613
+ - presence
3614
+ - try
3615
+ - try!
3616
+
3617
+ Style/Sample:
3618
+ Description: >-
3619
+ Use `sample` instead of `shuffle.first`,
3620
+ `shuffle.last`, and `shuffle[Integer]`.
3621
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
3622
+ Enabled: true
3623
+ VersionAdded: '0.30'
3624
+
3625
+ Style/SelfAssignment:
3626
+ Description: >-
3627
+ Checks for places where self-assignment shorthand should have
3628
+ been used.
3629
+ StyleGuide: '#self-assignment'
3630
+ Enabled: true
3631
+ VersionAdded: '0.19'
3632
+ VersionChanged: '0.29'
3633
+
3634
+ Style/Semicolon:
3635
+ Description: "Don't use semicolons to terminate expressions."
3636
+ StyleGuide: '#no-semicolon'
3637
+ Enabled: true
3638
+ VersionAdded: '0.9'
3639
+ VersionChanged: '0.19'
3640
+ # Allow `;` to separate several expressions on the same line.
3641
+ AllowAsExpressionSeparator: false
3642
+
3643
+ Style/Send:
3644
+ Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.'
3645
+ StyleGuide: '#prefer-public-send'
3646
+ Enabled: false
3647
+ VersionAdded: '0.33'
3648
+
3649
+ Style/SignalException:
3650
+ Description: 'Checks for proper usage of fail and raise.'
3651
+ StyleGuide: '#prefer-raise-over-fail'
3652
+ Enabled: true
3653
+ VersionAdded: '0.11'
3654
+ VersionChanged: '0.37'
3655
+ EnforcedStyle: only_raise
3656
+ SupportedStyles:
3657
+ - only_raise
3658
+ - only_fail
3659
+ - semantic
3660
+
3661
+ Style/SingleLineBlockParams:
3662
+ Description: 'Enforces the names of some block params.'
3663
+ Enabled: false
3664
+ VersionAdded: '0.16'
3665
+ VersionChanged: '0.47'
3666
+ Methods:
3667
+ - reduce:
3668
+ - acc
3669
+ - elem
3670
+ - inject:
3671
+ - acc
3672
+ - elem
3673
+
3674
+ Style/SingleLineMethods:
3675
+ Description: 'Avoid single-line methods.'
3676
+ StyleGuide: '#no-single-line-methods'
3677
+ Enabled: true
3678
+ VersionAdded: '0.9'
3679
+ VersionChanged: '0.19'
3680
+ AllowIfMethodIsEmpty: true
3681
+
3682
+ Style/SpecialGlobalVars:
3683
+ Description: 'Avoid Perl-style global variables.'
3684
+ StyleGuide: '#no-cryptic-perlisms'
3685
+ Enabled: true
3686
+ VersionAdded: '0.13'
3687
+ VersionChanged: '0.36'
3688
+ SafeAutoCorrect: false
3689
+ EnforcedStyle: use_english_names
3690
+ SupportedStyles:
3691
+ - use_perl_names
3692
+ - use_english_names
3693
+
3694
+ Style/StabbyLambdaParentheses:
3695
+ Description: 'Check for the usage of parentheses around stabby lambda arguments.'
3696
+ StyleGuide: '#stabby-lambda-with-args'
3697
+ Enabled: true
3698
+ VersionAdded: '0.35'
3699
+ EnforcedStyle: require_parentheses
3700
+ SupportedStyles:
3701
+ - require_parentheses
3702
+ - require_no_parentheses
3703
+
3704
+ Style/StderrPuts:
3705
+ Description: 'Use `warn` instead of `$stderr.puts`.'
3706
+ StyleGuide: '#warn'
3707
+ Enabled: true
3708
+ VersionAdded: '0.51'
3709
+
3710
+ Style/StringHashKeys:
3711
+ Description: 'Prefer symbols instead of strings as hash keys.'
3712
+ StyleGuide: '#symbols-as-keys'
3713
+ Enabled: false
3714
+ VersionAdded: '0.52'
3715
+ VersionChanged: '0.75'
3716
+ Safe: false
3717
+
3718
+ Style/StringLiterals:
3719
+ Description: 'Checks if uses of quotes match the configured preference.'
3720
+ StyleGuide: '#consistent-string-literals'
3721
+ Enabled: true
3722
+ VersionAdded: '0.9'
3723
+ VersionChanged: '0.36'
3724
+ EnforcedStyle: single_quotes
3725
+ SupportedStyles:
3726
+ - single_quotes
3727
+ - double_quotes
3728
+ # If `true`, strings which span multiple lines using `\` for continuation must
3729
+ # use the same type of quotes on each line.
3730
+ ConsistentQuotesInMultiline: false
3731
+
3732
+ Style/StringLiteralsInInterpolation:
3733
+ Description: >-
3734
+ Checks if uses of quotes inside expressions in interpolated
3735
+ strings match the configured preference.
3736
+ Enabled: true
3737
+ VersionAdded: '0.27'
3738
+ EnforcedStyle: single_quotes
3739
+ SupportedStyles:
3740
+ - single_quotes
3741
+ - double_quotes
3742
+
3743
+ Style/StringMethods:
3744
+ Description: 'Checks if configured preferred methods are used over non-preferred.'
3745
+ Enabled: false
3746
+ VersionAdded: '0.34'
3747
+ VersionChanged: '0.34.2'
3748
+ # Mapping from undesired method to desired_method
3749
+ # e.g. to use `to_sym` over `intern`:
3750
+ #
3751
+ # StringMethods:
3752
+ # PreferredMethods:
3753
+ # intern: to_sym
3754
+ PreferredMethods:
3755
+ intern: to_sym
3756
+
3757
+ Style/Strip:
3758
+ Description: 'Use `strip` instead of `lstrip.rstrip`.'
3759
+ Enabled: true
3760
+ VersionAdded: '0.36'
3761
+
3762
+ Style/StructInheritance:
3763
+ Description: 'Checks for inheritance from Struct.new.'
3764
+ StyleGuide: '#no-extend-struct-new'
3765
+ Enabled: true
3766
+ VersionAdded: '0.29'
3767
+
3768
+ Style/SymbolArray:
3769
+ Description: 'Use %i or %I for arrays of symbols.'
3770
+ StyleGuide: '#percent-i'
3771
+ Enabled: true
3772
+ VersionAdded: '0.9'
3773
+ VersionChanged: '0.49'
3774
+ EnforcedStyle: percent
3775
+ MinSize: 2
3776
+ SupportedStyles:
3777
+ - percent
3778
+ - brackets
3779
+
3780
+ Style/SymbolLiteral:
3781
+ Description: 'Use plain symbols instead of string symbols when possible.'
3782
+ Enabled: true
3783
+ VersionAdded: '0.30'
3784
+
3785
+ Style/SymbolProc:
3786
+ Description: 'Use symbols as procs instead of blocks when possible.'
3787
+ Enabled: true
3788
+ SafeAutoCorrect: false
3789
+ VersionAdded: '0.26'
3790
+ VersionChanged: '0.64'
3791
+ # A list of method names to be ignored by the check.
3792
+ # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
3793
+ IgnoredMethods:
3794
+ - respond_to
3795
+ - define_method
3796
+
3797
+ Style/TernaryParentheses:
3798
+ Description: 'Checks for use of parentheses around ternary conditions.'
3799
+ Enabled: true
3800
+ VersionAdded: '0.42'
3801
+ VersionChanged: '0.46'
3802
+ EnforcedStyle: require_no_parentheses
3803
+ SupportedStyles:
3804
+ - require_parentheses
3805
+ - require_no_parentheses
3806
+ - require_parentheses_when_complex
3807
+ AllowSafeAssignment: true
3808
+
3809
+ Style/TrailingBodyOnClass:
3810
+ Description: 'Class body goes below class statement.'
3811
+ Enabled: true
3812
+ VersionAdded: '0.53'
3813
+
3814
+ Style/TrailingBodyOnMethodDefinition:
3815
+ Description: 'Method body goes below definition.'
3816
+ Enabled: true
3817
+ VersionAdded: '0.52'
3818
+
3819
+ Style/TrailingBodyOnModule:
3820
+ Description: 'Module body goes below module statement.'
3821
+ Enabled: true
3822
+ VersionAdded: '0.53'
3823
+
3824
+ Style/TrailingCommaInArguments:
3825
+ Description: 'Checks for trailing comma in argument lists.'
3826
+ StyleGuide: '#no-trailing-params-comma'
3827
+ Enabled: true
3828
+ VersionAdded: '0.36'
3829
+ # If `comma`, the cop requires a comma after the last argument, but only for
3830
+ # parenthesized method calls where each argument is on its own line.
3831
+ # If `consistent_comma`, the cop requires a comma after the last argument,
3832
+ # for all parenthesized method calls with arguments.
3833
+ EnforcedStyleForMultiline: no_comma
3834
+ SupportedStylesForMultiline:
3835
+ - comma
3836
+ - consistent_comma
3837
+ - no_comma
3838
+
3839
+ Style/TrailingCommaInArrayLiteral:
3840
+ Description: 'Checks for trailing comma in array literals.'
3841
+ StyleGuide: '#no-trailing-array-commas'
3842
+ Enabled: true
3843
+ VersionAdded: '0.53'
3844
+ # If `comma`, the cop requires a comma after the last item in an array,
3845
+ # but only when each item is on its own line.
3846
+ # If `consistent_comma`, the cop requires a comma after the last item of all
3847
+ # non-empty, multiline array literals.
3848
+ EnforcedStyleForMultiline: no_comma
3849
+ SupportedStylesForMultiline:
3850
+ - comma
3851
+ - consistent_comma
3852
+ - no_comma
3853
+
3854
+ Style/TrailingCommaInBlockArgs:
3855
+ Description: 'Checks for useless trailing commas in block arguments.'
3856
+ Enabled: false
3857
+ Safe: false
3858
+ VersionAdded: '0.81'
3859
+
3860
+ Style/TrailingCommaInHashLiteral:
3861
+ Description: 'Checks for trailing comma in hash literals.'
3862
+ Enabled: true
3863
+ # If `comma`, the cop requires a comma after the last item in a hash,
3864
+ # but only when each item is on its own line.
3865
+ # If `consistent_comma`, the cop requires a comma after the last item of all
3866
+ # non-empty, multiline hash literals.
3867
+ EnforcedStyleForMultiline: no_comma
3868
+ SupportedStylesForMultiline:
3869
+ - comma
3870
+ - consistent_comma
3871
+ - no_comma
3872
+ VersionAdded: '0.53'
3873
+
3874
+ Style/TrailingMethodEndStatement:
3875
+ Description: 'Checks for trailing end statement on line of method body.'
3876
+ Enabled: true
3877
+ VersionAdded: '0.52'
3878
+
3879
+ Style/TrailingUnderscoreVariable:
3880
+ Description: >-
3881
+ Checks for the usage of unneeded trailing underscores at the
3882
+ end of parallel variable assignment.
3883
+ AllowNamedUnderscoreVariables: true
3884
+ Enabled: true
3885
+ VersionAdded: '0.31'
3886
+ VersionChanged: '0.35'
3887
+
3888
+ # `TrivialAccessors` requires exact name matches and doesn't allow
3889
+ # predicated methods by default.
3890
+ Style/TrivialAccessors:
3891
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
3892
+ StyleGuide: '#attr_family'
3893
+ Enabled: true
3894
+ VersionAdded: '0.9'
3895
+ VersionChanged: '0.77'
3896
+ # When set to `false` the cop will suggest the use of accessor methods
3897
+ # in situations like:
3898
+ #
3899
+ # def name
3900
+ # @other_name
3901
+ # end
3902
+ #
3903
+ # This way you can uncover "hidden" attributes in your code.
3904
+ ExactNameMatch: true
3905
+ AllowPredicates: true
3906
+ # Allows trivial writers that don't end in an equal sign. e.g.
3907
+ #
3908
+ # def on_exception(action)
3909
+ # @on_exception=action
3910
+ # end
3911
+ # on_exception :restart
3912
+ #
3913
+ # Commonly used in DSLs
3914
+ AllowDSLWriters: false
3915
+ IgnoreClassMethods: false
3916
+ AllowedMethods:
3917
+ - to_ary
3918
+ - to_a
3919
+ - to_c
3920
+ - to_enum
3921
+ - to_h
3922
+ - to_hash
3923
+ - to_i
3924
+ - to_int
3925
+ - to_io
3926
+ - to_open
3927
+ - to_path
3928
+ - to_proc
3929
+ - to_r
3930
+ - to_regexp
3931
+ - to_str
3932
+ - to_s
3933
+ - to_sym
3934
+
3935
+ Style/UnlessElse:
3936
+ Description: >-
3937
+ Do not use unless with else. Rewrite these with the positive
3938
+ case first.
3939
+ StyleGuide: '#no-else-with-unless'
3940
+ Enabled: true
3941
+ VersionAdded: '0.9'
3942
+
3943
+ Style/UnpackFirst:
3944
+ Description: >-
3945
+ Checks for accessing the first element of `String#unpack`
3946
+ instead of using `unpack1`.
3947
+ Enabled: true
3948
+ VersionAdded: '0.54'
3949
+
3950
+ Style/VariableInterpolation:
3951
+ Description: >-
3952
+ Don't interpolate global, instance and class variables
3953
+ directly in strings.
3954
+ StyleGuide: '#curlies-interpolate'
3955
+ Enabled: true
3956
+ VersionAdded: '0.9'
3957
+ VersionChanged: '0.20'
3958
+
3959
+ Style/WhenThen:
3960
+ Description: 'Use when x then ... for one-line cases.'
3961
+ StyleGuide: '#one-line-cases'
3962
+ Enabled: true
3963
+ VersionAdded: '0.9'
3964
+
3965
+ Style/WhileUntilDo:
3966
+ Description: 'Checks for redundant do after while or until.'
3967
+ StyleGuide: '#no-multiline-while-do'
3968
+ Enabled: true
3969
+ VersionAdded: '0.9'
3970
+
3971
+ Style/WhileUntilModifier:
3972
+ Description: >-
3973
+ Favor modifier while/until usage when you have a
3974
+ single-line body.
3975
+ StyleGuide: '#while-as-a-modifier'
3976
+ Enabled: true
3977
+ VersionAdded: '0.9'
3978
+ VersionChanged: '0.30'
3979
+
3980
+ Style/WordArray:
3981
+ Description: 'Use %w or %W for arrays of words.'
3982
+ StyleGuide: '#percent-w'
3983
+ Enabled: true
3984
+ VersionAdded: '0.9'
3985
+ VersionChanged: '0.36'
3986
+ EnforcedStyle: percent
3987
+ SupportedStyles:
3988
+ # percent style: %w(word1 word2)
3989
+ - percent
3990
+ # bracket style: ['word1', 'word2']
3991
+ - brackets
3992
+ # The `MinSize` option causes the `WordArray` rule to be ignored for arrays
3993
+ # smaller than a certain size. The rule is only applied to arrays
3994
+ # whose element count is greater than or equal to `MinSize`.
3995
+ MinSize: 2
3996
+ # The regular expression `WordRegex` decides what is considered a word.
3997
+ WordRegex: !ruby/regexp '/\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/'
3998
+
3999
+ Style/YodaCondition:
4000
+ Description: 'Forbid or enforce yoda conditions.'
4001
+ Reference: 'https://en.wikipedia.org/wiki/Yoda_conditions'
4002
+ Enabled: true
4003
+ EnforcedStyle: forbid_for_all_comparison_operators
4004
+ SupportedStyles:
4005
+ # check all comparison operators
4006
+ - forbid_for_all_comparison_operators
4007
+ # check only equality operators: `!=` and `==`
4008
+ - forbid_for_equality_operators_only
4009
+ # enforce yoda for all comparison operators
4010
+ - require_for_all_comparison_operators
4011
+ # enforce yoda only for equality operators: `!=` and `==`
4012
+ - require_for_equality_operators_only
4013
+ Safe: false
4014
+ VersionAdded: '0.49'
4015
+ VersionChanged: '0.75'
4016
+
4017
+ Style/ZeroLengthPredicate:
4018
+ Description: 'Use #empty? when testing for objects of length 0.'
4019
+ Enabled: true
4020
+ Safe: false
4021
+ VersionAdded: '0.37'
4022
+ VersionChanged: '0.39'