rubocop 0.60.0 → 0.61.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/config/default.yml +573 -560
- data/lib/rubocop.rb +5 -0
- data/lib/rubocop/ast/node.rb +1 -1
- data/lib/rubocop/ast/sexp.rb +1 -1
- data/lib/rubocop/cli.rb +9 -14
- data/lib/rubocop/config.rb +4 -3
- data/lib/rubocop/config_loader.rb +25 -22
- data/lib/rubocop/config_loader_resolver.rb +3 -2
- data/lib/rubocop/cop/correctors/each_to_for_corrector.rb +53 -0
- data/lib/rubocop/cop/correctors/for_to_each_corrector.rb +73 -0
- data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +138 -0
- data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +52 -46
- data/lib/rubocop/cop/generator.rb +13 -17
- data/lib/rubocop/cop/generator/configuration_injector.rb +60 -0
- data/lib/rubocop/cop/layout/align_hash.rb +3 -0
- data/lib/rubocop/cop/layout/comment_indentation.rb +32 -2
- data/lib/rubocop/cop/layout/indent_heredoc.rb +11 -5
- data/lib/rubocop/cop/layout/indentation_width.rb +7 -1
- data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +11 -11
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +1 -1
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +16 -3
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +30 -17
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +11 -0
- data/lib/rubocop/cop/lint/shadowed_exception.rb +2 -5
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +1 -1
- data/lib/rubocop/cop/metrics/line_length.rb +2 -2
- data/lib/rubocop/cop/mixin/trailing_comma.rb +11 -15
- data/lib/rubocop/cop/offense.rb +1 -1
- data/lib/rubocop/cop/performance/open_struct.rb +46 -0
- data/lib/rubocop/cop/performance/redundant_merge.rb +18 -4
- data/lib/rubocop/cop/rails/bulk_change_table.rb +2 -2
- data/lib/rubocop/cop/rails/dynamic_find_by.rb +15 -8
- data/lib/rubocop/cop/rails/http_positional_arguments.rb +17 -14
- data/lib/rubocop/cop/rails/http_status.rb +4 -4
- data/lib/rubocop/cop/rails/inverse_of.rb +2 -2
- data/lib/rubocop/cop/rails/reversible_migration.rb +1 -1
- data/lib/rubocop/cop/rails/skips_model_validations.rb +1 -1
- data/lib/rubocop/cop/rails/validation.rb +4 -4
- data/lib/rubocop/cop/security/open.rb +31 -11
- data/lib/rubocop/cop/style/begin_block.rb +6 -0
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +1 -1
- data/lib/rubocop/cop/style/empty_case_condition.rb +13 -7
- data/lib/rubocop/cop/style/for.rb +9 -78
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +6 -4
- data/lib/rubocop/cop/style/global_vars.rb +1 -1
- data/lib/rubocop/cop/style/infinite_loop.rb +42 -6
- data/lib/rubocop/cop/style/lambda.rb +4 -87
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +221 -16
- data/lib/rubocop/cop/style/raise_args.rb +1 -1
- data/lib/rubocop/cop/style/regexp_literal.rb +62 -10
- data/lib/rubocop/cop/style/unneeded_condition.rb +2 -2
- data/lib/rubocop/cop/variable_force.rb +4 -2
- data/lib/rubocop/cop/variable_force/variable.rb +2 -0
- data/lib/rubocop/magic_comment.rb +1 -1
- data/lib/rubocop/remote_config.rb +13 -4
- data/lib/rubocop/rspec/expect_offense.rb +1 -1
- data/lib/rubocop/runner.rb +15 -4
- data/lib/rubocop/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e88fc0398de2241ea3dbc2ef8403018874800ea68f78cbb450fba8e44a1571cd
|
4
|
+
data.tar.gz: cce387c16f166a02b9fec1de5e8d13cc3392f67b1ed9f786411a33cb3ced24ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '02226368c150bca198e27e3b389f59b851e8a027ebb740d7a3caf20756afa68b8509dabd2cd3d02c8906607034544637933e90f9f1e06651d08d6d32018d345c'
|
7
|
+
data.tar.gz: b745797d0eba8bf0f729f7e7ad1ff0ad0fe110fa3ef0fb62c1f4519dcae9191a5e953c83f3dcbb978959b4141e39cc946f5246fc5e264f42769ae9cd5134ad1b
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/rubocop.svg)](
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/rubocop.svg)](https://badge.fury.io/rb/rubocop)
|
2
2
|
[![CircleCI Status](https://circleci.com/gh/rubocop-hq/rubocop/tree/master.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop/tree/master)
|
3
3
|
[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/sj3ye7n5690d0nvg?svg=true)](https://ci.appveyor.com/project/bbatsov/rubocop)
|
4
4
|
[![Coverage Status](https://img.shields.io/codeclimate/coverage/github/bbatsov/rubocop.svg)](https://codeclimate.com/github/bbatsov/rubocop)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/bbatsov/rubocop/badges/gpa.svg)](https://codeclimate.com/github/bbatsov/rubocop)
|
6
|
-
[![Inline docs](
|
6
|
+
[![Inline docs](https://inch-ci.org/github/bbatsov/rubocop.svg)](https://inch-ci.org/github/bbatsov/rubocop)
|
7
7
|
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rubocop&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=rubocop&package-manager=bundler&version-scheme=semver)
|
8
8
|
|
9
9
|
[![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/bbatsov)
|
@@ -53,7 +53,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
|
|
53
53
|
might want to use a conservative version locking in your `Gemfile`:
|
54
54
|
|
55
55
|
```rb
|
56
|
-
gem 'rubocop', '~> 0.
|
56
|
+
gem 'rubocop', '~> 0.61.0', require: false
|
57
57
|
```
|
58
58
|
|
59
59
|
## Quickstart
|
@@ -99,7 +99,7 @@ RuboCop's logo was created by [Dimiter Petrov](https://www.chadomoto.com/). You
|
|
99
99
|
formats [here](https://github.com/rubocop-hq/rubocop/tree/master/logo).
|
100
100
|
|
101
101
|
The logo is licensed under a
|
102
|
-
[Creative Commons Attribution-NonCommercial 4.0 International License](
|
102
|
+
[Creative Commons Attribution-NonCommercial 4.0 International License](https://creativecommons.org/licenses/by-nc/4.0/deed.en_GB).
|
103
103
|
|
104
104
|
## Contributors
|
105
105
|
|
data/config/default.yml
CHANGED
@@ -139,7 +139,7 @@ AllCops:
|
|
139
139
|
Bundler/DuplicatedGem:
|
140
140
|
Description: 'Checks for duplicate gem entries in Gemfile.'
|
141
141
|
Enabled: true
|
142
|
-
VersionAdded: 0.46
|
142
|
+
VersionAdded: '0.46'
|
143
143
|
Include:
|
144
144
|
- '**/*.gemfile'
|
145
145
|
- '**/Gemfile'
|
@@ -148,7 +148,7 @@ Bundler/DuplicatedGem:
|
|
148
148
|
Bundler/GemComment:
|
149
149
|
Description: 'Add a comment describing each gem.'
|
150
150
|
Enabled: false
|
151
|
-
VersionAdded: 0.59
|
151
|
+
VersionAdded: '0.59'
|
152
152
|
Include:
|
153
153
|
- '**/*.gemfile'
|
154
154
|
- '**/Gemfile'
|
@@ -161,7 +161,7 @@ Bundler/InsecureProtocolSource:
|
|
161
161
|
because HTTP requests are insecure. Please change your source to
|
162
162
|
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
|
163
163
|
Enabled: true
|
164
|
-
VersionAdded: 0.50
|
164
|
+
VersionAdded: '0.50'
|
165
165
|
Include:
|
166
166
|
- '**/*.gemfile'
|
167
167
|
- '**/Gemfile'
|
@@ -171,8 +171,8 @@ Bundler/OrderedGems:
|
|
171
171
|
Description: >-
|
172
172
|
Gems within groups in the Gemfile should be alphabetically sorted.
|
173
173
|
Enabled: true
|
174
|
-
VersionAdded: 0.46
|
175
|
-
VersionChanged: 0.47
|
174
|
+
VersionAdded: '0.46'
|
175
|
+
VersionChanged: '0.47'
|
176
176
|
TreatCommentsAsGroupSeparators: true
|
177
177
|
Include:
|
178
178
|
- '**/*.gemfile'
|
@@ -184,7 +184,7 @@ Bundler/OrderedGems:
|
|
184
184
|
Gemspec/DuplicatedAssignment:
|
185
185
|
Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
|
186
186
|
Enabled: true
|
187
|
-
VersionAdded: 0.52
|
187
|
+
VersionAdded: '0.52'
|
188
188
|
Include:
|
189
189
|
- '**/*.gemspec'
|
190
190
|
|
@@ -192,7 +192,7 @@ Gemspec/OrderedDependencies:
|
|
192
192
|
Description: >-
|
193
193
|
Dependencies in the gemspec should be alphabetically sorted.
|
194
194
|
Enabled: true
|
195
|
-
VersionAdded: 0.51
|
195
|
+
VersionAdded: '0.51'
|
196
196
|
TreatCommentsAsGroupSeparators: true
|
197
197
|
Include:
|
198
198
|
- '**/*.gemspec'
|
@@ -200,7 +200,7 @@ Gemspec/OrderedDependencies:
|
|
200
200
|
Gemspec/RequiredRubyVersion:
|
201
201
|
Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
|
202
202
|
Enabled: true
|
203
|
-
VersionAdded: 0.52
|
203
|
+
VersionAdded: '0.52'
|
204
204
|
Include:
|
205
205
|
- '**/*.gemspec'
|
206
206
|
|
@@ -210,7 +210,7 @@ Layout/AccessModifierIndentation:
|
|
210
210
|
Description: Check indentation of private/protected visibility modifiers.
|
211
211
|
StyleGuide: '#indent-public-private-protected'
|
212
212
|
Enabled: true
|
213
|
-
VersionAdded: 0.49
|
213
|
+
VersionAdded: '0.49'
|
214
214
|
EnforcedStyle: indent
|
215
215
|
SupportedStyles:
|
216
216
|
- outdent
|
@@ -225,14 +225,14 @@ Layout/AlignArray:
|
|
225
225
|
one line.
|
226
226
|
StyleGuide: '#align-multiline-arrays'
|
227
227
|
Enabled: true
|
228
|
-
VersionAdded: 0.49
|
228
|
+
VersionAdded: '0.49'
|
229
229
|
|
230
230
|
Layout/AlignHash:
|
231
231
|
Description: >-
|
232
232
|
Align the elements of a hash literal if they span more than
|
233
233
|
one line.
|
234
234
|
Enabled: true
|
235
|
-
VersionAdded: 0.49
|
235
|
+
VersionAdded: '0.49'
|
236
236
|
# Alignment of entries using hash rocket as separator. Valid values are:
|
237
237
|
#
|
238
238
|
# key - left alignment of keys
|
@@ -309,7 +309,7 @@ Layout/AlignParameters:
|
|
309
309
|
than one line.
|
310
310
|
StyleGuide: '#no-double-indent'
|
311
311
|
Enabled: true
|
312
|
-
VersionAdded: 0.49
|
312
|
+
VersionAdded: '0.49'
|
313
313
|
# Alignment of parameters in multi-line method calls.
|
314
314
|
#
|
315
315
|
# The `with_first_parameter` style aligns the following lines along the same
|
@@ -334,7 +334,7 @@ Layout/AlignParameters:
|
|
334
334
|
Layout/BlockAlignment:
|
335
335
|
Description: 'Align block ends correctly.'
|
336
336
|
Enabled: true
|
337
|
-
VersionAdded: 0.53
|
337
|
+
VersionAdded: '0.53'
|
338
338
|
# The value `start_of_block` means that the `end` should be aligned with line
|
339
339
|
# where the `do` keyword appears.
|
340
340
|
# The value `start_of_line` means it should be aligned with the whole
|
@@ -349,13 +349,13 @@ Layout/BlockAlignment:
|
|
349
349
|
Layout/BlockEndNewline:
|
350
350
|
Description: 'Put end statement of multiline block on its own line.'
|
351
351
|
Enabled: true
|
352
|
-
VersionAdded: 0.49
|
352
|
+
VersionAdded: '0.49'
|
353
353
|
|
354
354
|
Layout/CaseIndentation:
|
355
355
|
Description: 'Indentation of when in a case/when/[else/]end.'
|
356
356
|
StyleGuide: '#indent-when-to-case'
|
357
357
|
Enabled: true
|
358
|
-
VersionAdded: 0.49
|
358
|
+
VersionAdded: '0.49'
|
359
359
|
EnforcedStyle: case
|
360
360
|
SupportedStyles:
|
361
361
|
- case
|
@@ -370,7 +370,7 @@ Layout/ClassStructure:
|
|
370
370
|
Description: 'Enforces a configured order of definitions within a class body.'
|
371
371
|
StyleGuide: 'https://github.com/rubocop-hq/ruby-style-guide#consistent-classes'
|
372
372
|
Enabled: false
|
373
|
-
VersionAdded: 0.52
|
373
|
+
VersionAdded: '0.52'
|
374
374
|
Categories:
|
375
375
|
module_inclusion:
|
376
376
|
- include
|
@@ -388,17 +388,17 @@ Layout/ClassStructure:
|
|
388
388
|
Layout/ClosingHeredocIndentation:
|
389
389
|
Description: 'Checks the indentation of here document closings.'
|
390
390
|
Enabled: true
|
391
|
-
VersionAdded: 0.57
|
391
|
+
VersionAdded: '0.57'
|
392
392
|
|
393
393
|
Layout/ClosingParenthesisIndentation:
|
394
394
|
Description: 'Checks the indentation of hanging closing parentheses.'
|
395
395
|
Enabled: true
|
396
|
-
VersionAdded: 0.49
|
396
|
+
VersionAdded: '0.49'
|
397
397
|
|
398
398
|
Layout/CommentIndentation:
|
399
399
|
Description: 'Indentation of comments.'
|
400
400
|
Enabled: true
|
401
|
-
VersionAdded: 0.49
|
401
|
+
VersionAdded: '0.49'
|
402
402
|
|
403
403
|
Layout/ConditionPosition:
|
404
404
|
Description: >-
|
@@ -406,12 +406,12 @@ Layout/ConditionPosition:
|
|
406
406
|
the keyword.
|
407
407
|
StyleGuide: '#same-line-condition'
|
408
408
|
Enabled: true
|
409
|
-
VersionAdded: 0.53
|
409
|
+
VersionAdded: '0.53'
|
410
410
|
|
411
411
|
Layout/DefEndAlignment:
|
412
412
|
Description: 'Align ends corresponding to defs correctly.'
|
413
413
|
Enabled: true
|
414
|
-
VersionAdded: 0.53
|
414
|
+
VersionAdded: '0.53'
|
415
415
|
# The value `def` means that `end` should be aligned with the def keyword.
|
416
416
|
# The value `start_of_line` means that `end` should be aligned with method
|
417
417
|
# calls like `private`, `public`, etc, if present in front of the `def`
|
@@ -427,7 +427,7 @@ Layout/DotPosition:
|
|
427
427
|
Description: 'Checks the position of the dot in multi-line method calls.'
|
428
428
|
StyleGuide: '#consistent-multi-line-chains'
|
429
429
|
Enabled: true
|
430
|
-
VersionAdded: 0.49
|
430
|
+
VersionAdded: '0.49'
|
431
431
|
EnforcedStyle: leading
|
432
432
|
SupportedStyles:
|
433
433
|
- leading
|
@@ -436,32 +436,32 @@ Layout/DotPosition:
|
|
436
436
|
Layout/ElseAlignment:
|
437
437
|
Description: 'Align elses and elsifs correctly.'
|
438
438
|
Enabled: true
|
439
|
-
VersionAdded: 0.49
|
439
|
+
VersionAdded: '0.49'
|
440
440
|
|
441
441
|
Layout/EmptyComment:
|
442
442
|
Description: 'Checks empty comment.'
|
443
443
|
Enabled: true
|
444
|
-
VersionAdded: 0.53
|
444
|
+
VersionAdded: '0.53'
|
445
445
|
AllowBorderComment: true
|
446
446
|
AllowMarginComment: true
|
447
447
|
|
448
448
|
Layout/EmptyLineAfterGuardClause:
|
449
449
|
Description: 'Add empty line after guard clause.'
|
450
450
|
Enabled: true
|
451
|
-
VersionAdded: 0.56
|
452
|
-
VersionChanged: 0.59
|
451
|
+
VersionAdded: '0.56'
|
452
|
+
VersionChanged: '0.59'
|
453
453
|
|
454
454
|
Layout/EmptyLineAfterMagicComment:
|
455
455
|
Description: 'Add an empty line after magic comments to separate them from code.'
|
456
456
|
StyleGuide: '#separate-magic-comments-from-code'
|
457
457
|
Enabled: true
|
458
|
-
VersionAdded: 0.49
|
458
|
+
VersionAdded: '0.49'
|
459
459
|
|
460
460
|
Layout/EmptyLineBetweenDefs:
|
461
461
|
Description: 'Use empty lines between defs.'
|
462
462
|
StyleGuide: '#empty-lines-between-methods'
|
463
463
|
Enabled: true
|
464
|
-
VersionAdded: 0.49
|
464
|
+
VersionAdded: '0.49'
|
465
465
|
# If `true`, this parameter means that single line method definitions don't
|
466
466
|
# need an empty line between them.
|
467
467
|
AllowAdjacentOneLineDefs: false
|
@@ -472,30 +472,30 @@ Layout/EmptyLines:
|
|
472
472
|
Description: "Don't use several empty lines in a row."
|
473
473
|
StyleGuide: '#two-or-more-empty-lines'
|
474
474
|
Enabled: true
|
475
|
-
VersionAdded: 0.49
|
475
|
+
VersionAdded: '0.49'
|
476
476
|
|
477
477
|
Layout/EmptyLinesAroundAccessModifier:
|
478
478
|
Description: "Keep blank lines around access modifiers."
|
479
479
|
StyleGuide: '#empty-lines-around-access-modifier'
|
480
480
|
Enabled: true
|
481
|
-
VersionAdded: 0.49
|
481
|
+
VersionAdded: '0.49'
|
482
482
|
|
483
483
|
Layout/EmptyLinesAroundArguments:
|
484
484
|
Description: "Keeps track of empty lines around method arguments."
|
485
485
|
Enabled: true
|
486
|
-
VersionAdded: 0.52
|
486
|
+
VersionAdded: '0.52'
|
487
487
|
|
488
488
|
Layout/EmptyLinesAroundBeginBody:
|
489
489
|
Description: "Keeps track of empty lines around begin-end bodies."
|
490
490
|
StyleGuide: '#empty-lines-around-bodies'
|
491
491
|
Enabled: true
|
492
|
-
VersionAdded: 0.49
|
492
|
+
VersionAdded: '0.49'
|
493
493
|
|
494
494
|
Layout/EmptyLinesAroundBlockBody:
|
495
495
|
Description: "Keeps track of empty lines around block bodies."
|
496
496
|
StyleGuide: '#empty-lines-around-bodies'
|
497
497
|
Enabled: true
|
498
|
-
VersionAdded: 0.49
|
498
|
+
VersionAdded: '0.49'
|
499
499
|
EnforcedStyle: no_empty_lines
|
500
500
|
SupportedStyles:
|
501
501
|
- empty_lines
|
@@ -505,8 +505,8 @@ Layout/EmptyLinesAroundClassBody:
|
|
505
505
|
Description: "Keeps track of empty lines around class bodies."
|
506
506
|
StyleGuide: '#empty-lines-around-bodies'
|
507
507
|
Enabled: true
|
508
|
-
VersionAdded: 0.49
|
509
|
-
VersionChanged: 0.53
|
508
|
+
VersionAdded: '0.49'
|
509
|
+
VersionChanged: '0.53'
|
510
510
|
EnforcedStyle: no_empty_lines
|
511
511
|
SupportedStyles:
|
512
512
|
- empty_lines
|
@@ -520,19 +520,19 @@ Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
|
520
520
|
Description: "Keeps track of empty lines around exception handling keywords."
|
521
521
|
StyleGuide: '#empty-lines-around-bodies'
|
522
522
|
Enabled: true
|
523
|
-
VersionAdded: 0.49
|
523
|
+
VersionAdded: '0.49'
|
524
524
|
|
525
525
|
Layout/EmptyLinesAroundMethodBody:
|
526
526
|
Description: "Keeps track of empty lines around method bodies."
|
527
527
|
StyleGuide: '#empty-lines-around-bodies'
|
528
528
|
Enabled: true
|
529
|
-
VersionAdded: 0.49
|
529
|
+
VersionAdded: '0.49'
|
530
530
|
|
531
531
|
Layout/EmptyLinesAroundModuleBody:
|
532
532
|
Description: "Keeps track of empty lines around module bodies."
|
533
533
|
StyleGuide: '#empty-lines-around-bodies'
|
534
534
|
Enabled: true
|
535
|
-
VersionAdded: 0.49
|
535
|
+
VersionAdded: '0.49'
|
536
536
|
EnforcedStyle: no_empty_lines
|
537
537
|
SupportedStyles:
|
538
538
|
- empty_lines
|
@@ -543,7 +543,7 @@ Layout/EmptyLinesAroundModuleBody:
|
|
543
543
|
Layout/EndAlignment:
|
544
544
|
Description: 'Align ends correctly.'
|
545
545
|
Enabled: true
|
546
|
-
VersionAdded: 0.53
|
546
|
+
VersionAdded: '0.53'
|
547
547
|
# The value `keyword` means that `end` should be aligned with the matching
|
548
548
|
# keyword (`if`, `while`, etc.).
|
549
549
|
# The value `variable` means that in assignments, `end` should be aligned
|
@@ -563,7 +563,7 @@ Layout/EndOfLine:
|
|
563
563
|
Description: 'Use Unix-style line endings.'
|
564
564
|
StyleGuide: '#crlf'
|
565
565
|
Enabled: true
|
566
|
-
VersionAdded: 0.49
|
566
|
+
VersionAdded: '0.49'
|
567
567
|
# The `native` style means that CR+LF (Carriage Return + Line Feed) is
|
568
568
|
# enforced on Windows, and LF is enforced on other platforms. The other styles
|
569
569
|
# mean LF and CR+LF, respectively.
|
@@ -576,7 +576,7 @@ Layout/EndOfLine:
|
|
576
576
|
Layout/ExtraSpacing:
|
577
577
|
Description: 'Do not use unnecessary spacing.'
|
578
578
|
Enabled: true
|
579
|
-
VersionAdded: 0.49
|
579
|
+
VersionAdded: '0.49'
|
580
580
|
# When true, allows most uses of extra spacing if the intent is to align
|
581
581
|
# things with the previous or next line, not counting empty lines or comment
|
582
582
|
# lines.
|
@@ -589,34 +589,34 @@ Layout/FirstArrayElementLineBreak:
|
|
589
589
|
Checks for a line break before the first element in a
|
590
590
|
multi-line array.
|
591
591
|
Enabled: false
|
592
|
-
VersionAdded: 0.49
|
592
|
+
VersionAdded: '0.49'
|
593
593
|
|
594
594
|
Layout/FirstHashElementLineBreak:
|
595
595
|
Description: >-
|
596
596
|
Checks for a line break before the first element in a
|
597
597
|
multi-line hash.
|
598
598
|
Enabled: false
|
599
|
-
VersionAdded: 0.49
|
599
|
+
VersionAdded: '0.49'
|
600
600
|
|
601
601
|
Layout/FirstMethodArgumentLineBreak:
|
602
602
|
Description: >-
|
603
603
|
Checks for a line break before the first argument in a
|
604
604
|
multi-line method call.
|
605
605
|
Enabled: false
|
606
|
-
VersionAdded: 0.49
|
606
|
+
VersionAdded: '0.49'
|
607
607
|
|
608
608
|
Layout/FirstMethodParameterLineBreak:
|
609
609
|
Description: >-
|
610
610
|
Checks for a line break before the first parameter in a
|
611
611
|
multi-line method parameter definition.
|
612
612
|
Enabled: false
|
613
|
-
VersionAdded: 0.49
|
613
|
+
VersionAdded: '0.49'
|
614
614
|
|
615
615
|
Layout/FirstParameterIndentation:
|
616
616
|
Description: 'Checks the indentation of the first parameter in a method call.'
|
617
617
|
Enabled: true
|
618
|
-
VersionAdded: 0.49
|
619
|
-
VersionChanged: 0.56
|
618
|
+
VersionAdded: '0.49'
|
619
|
+
VersionChanged: '0.56'
|
620
620
|
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
621
621
|
SupportedStyles:
|
622
622
|
# The first parameter should always be indented one step more than the
|
@@ -642,7 +642,7 @@ Layout/IndentArray:
|
|
642
642
|
Checks the indentation of the first element in an array
|
643
643
|
literal.
|
644
644
|
Enabled: true
|
645
|
-
VersionAdded: 0.49
|
645
|
+
VersionAdded: '0.49'
|
646
646
|
# The value `special_inside_parentheses` means that array literals with
|
647
647
|
# brackets that have their opening bracket on the same line as a surrounding
|
648
648
|
# opening round parenthesis, shall have their first element indented relative
|
@@ -668,7 +668,7 @@ Layout/IndentAssignment:
|
|
668
668
|
Checks the indentation of the first line of the
|
669
669
|
right-hand-side of a multi-line assignment.
|
670
670
|
Enabled: true
|
671
|
-
VersionAdded: 0.49
|
671
|
+
VersionAdded: '0.49'
|
672
672
|
# By default, the indentation width from `Layout/IndentationWidth` is used
|
673
673
|
# But it can be overridden by setting this parameter
|
674
674
|
IndentationWidth: ~
|
@@ -676,7 +676,7 @@ Layout/IndentAssignment:
|
|
676
676
|
Layout/IndentHash:
|
677
677
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
678
678
|
Enabled: true
|
679
|
-
VersionAdded: 0.49
|
679
|
+
VersionAdded: '0.49'
|
680
680
|
# The value `special_inside_parentheses` means that hash literals with braces
|
681
681
|
# that have their opening brace on the same line as a surrounding opening
|
682
682
|
# round parenthesis, shall have their first key indented relative to the
|
@@ -701,7 +701,7 @@ Layout/IndentHeredoc:
|
|
701
701
|
Description: 'This cop checks the indentation of the here document bodies.'
|
702
702
|
StyleGuide: '#squiggly-heredocs'
|
703
703
|
Enabled: true
|
704
|
-
VersionAdded: 0.49
|
704
|
+
VersionAdded: '0.49'
|
705
705
|
EnforcedStyle: auto_detection
|
706
706
|
SupportedStyles:
|
707
707
|
- auto_detection
|
@@ -714,7 +714,7 @@ Layout/IndentationConsistency:
|
|
714
714
|
Description: 'Keep indentation straight.'
|
715
715
|
StyleGuide: '#spaces-indentation'
|
716
716
|
Enabled: true
|
717
|
-
VersionAdded: 0.49
|
717
|
+
VersionAdded: '0.49'
|
718
718
|
# The difference between `rails` and `normal` is that the `rails` style
|
719
719
|
# prescribes that in classes and modules the `protected` and `private`
|
720
720
|
# modifier keywords shall be indented the same as public methods and that
|
@@ -730,7 +730,7 @@ Layout/IndentationWidth:
|
|
730
730
|
Description: 'Use 2 spaces for indentation.'
|
731
731
|
StyleGuide: '#spaces-indentation'
|
732
732
|
Enabled: true
|
733
|
-
VersionAdded: 0.49
|
733
|
+
VersionAdded: '0.49'
|
734
734
|
# Number of spaces for each indentation level.
|
735
735
|
Width: 2
|
736
736
|
IgnoredPatterns: []
|
@@ -739,18 +739,18 @@ Layout/InitialIndentation:
|
|
739
739
|
Description: >-
|
740
740
|
Checks the indentation of the first non-blank non-comment line in a file.
|
741
741
|
Enabled: true
|
742
|
-
VersionAdded: 0.49
|
742
|
+
VersionAdded: '0.49'
|
743
743
|
|
744
744
|
Layout/LeadingBlankLines:
|
745
745
|
Description: Check for unnecessary blank lines at the beginning of a file.
|
746
746
|
Enabled: true
|
747
|
-
VersionAdded: 0.57
|
747
|
+
VersionAdded: '0.57'
|
748
748
|
|
749
749
|
Layout/LeadingCommentSpace:
|
750
750
|
Description: 'Comments should start with a space.'
|
751
751
|
StyleGuide: '#hash-space'
|
752
752
|
Enabled: true
|
753
|
-
VersionAdded: 0.49
|
753
|
+
VersionAdded: '0.49'
|
754
754
|
|
755
755
|
Layout/MultilineArrayBraceLayout:
|
756
756
|
Description: >-
|
@@ -758,7 +758,7 @@ Layout/MultilineArrayBraceLayout:
|
|
758
758
|
either on the same line as the last array element, or
|
759
759
|
a new line.
|
760
760
|
Enabled: true
|
761
|
-
VersionAdded: 0.49
|
761
|
+
VersionAdded: '0.49'
|
762
762
|
EnforcedStyle: symmetrical
|
763
763
|
SupportedStyles:
|
764
764
|
# symmetrical: closing brace is positioned in same way as opening brace
|
@@ -772,7 +772,7 @@ Layout/MultilineAssignmentLayout:
|
|
772
772
|
Description: 'Check for a newline after the assignment operator in multi-line assignments.'
|
773
773
|
StyleGuide: '#indent-conditional-assignment'
|
774
774
|
Enabled: false
|
775
|
-
VersionAdded: 0.49
|
775
|
+
VersionAdded: '0.49'
|
776
776
|
# The types of assignments which are subject to this rule.
|
777
777
|
SupportedTypes:
|
778
778
|
- block
|
@@ -793,7 +793,7 @@ Layout/MultilineAssignmentLayout:
|
|
793
793
|
Layout/MultilineBlockLayout:
|
794
794
|
Description: 'Ensures newlines after multiline block do statements.'
|
795
795
|
Enabled: true
|
796
|
-
VersionAdded: 0.49
|
796
|
+
VersionAdded: '0.49'
|
797
797
|
|
798
798
|
Layout/MultilineHashBraceLayout:
|
799
799
|
Description: >-
|
@@ -801,7 +801,7 @@ Layout/MultilineHashBraceLayout:
|
|
801
801
|
either on the same line as the last hash element, or
|
802
802
|
a new line.
|
803
803
|
Enabled: true
|
804
|
-
VersionAdded: 0.49
|
804
|
+
VersionAdded: '0.49'
|
805
805
|
EnforcedStyle: symmetrical
|
806
806
|
SupportedStyles:
|
807
807
|
# symmetrical: closing brace is positioned in same way as opening brace
|
@@ -817,7 +817,7 @@ Layout/MultilineMethodCallBraceLayout:
|
|
817
817
|
either on the same line as the last method argument, or
|
818
818
|
a new line.
|
819
819
|
Enabled: true
|
820
|
-
VersionAdded: 0.49
|
820
|
+
VersionAdded: '0.49'
|
821
821
|
EnforcedStyle: symmetrical
|
822
822
|
SupportedStyles:
|
823
823
|
# symmetrical: closing brace is positioned in same way as opening brace
|
@@ -832,7 +832,7 @@ Layout/MultilineMethodCallIndentation:
|
|
832
832
|
Checks indentation of method calls with the dot operator
|
833
833
|
that span more than one line.
|
834
834
|
Enabled: true
|
835
|
-
VersionAdded: 0.49
|
835
|
+
VersionAdded: '0.49'
|
836
836
|
EnforcedStyle: aligned
|
837
837
|
SupportedStyles:
|
838
838
|
- aligned
|
@@ -848,7 +848,7 @@ Layout/MultilineMethodDefinitionBraceLayout:
|
|
848
848
|
either on the same line as the last method parameter, or
|
849
849
|
a new line.
|
850
850
|
Enabled: true
|
851
|
-
VersionAdded: 0.49
|
851
|
+
VersionAdded: '0.49'
|
852
852
|
EnforcedStyle: symmetrical
|
853
853
|
SupportedStyles:
|
854
854
|
# symmetrical: closing brace is positioned in same way as opening brace
|
@@ -863,7 +863,7 @@ Layout/MultilineOperationIndentation:
|
|
863
863
|
Checks indentation of binary operations that span more than
|
864
864
|
one line.
|
865
865
|
Enabled: true
|
866
|
-
VersionAdded: 0.49
|
866
|
+
VersionAdded: '0.49'
|
867
867
|
EnforcedStyle: aligned
|
868
868
|
SupportedStyles:
|
869
869
|
- aligned
|
@@ -875,19 +875,19 @@ Layout/MultilineOperationIndentation:
|
|
875
875
|
Layout/RescueEnsureAlignment:
|
876
876
|
Description: 'Align rescues and ensures correctly.'
|
877
877
|
Enabled: true
|
878
|
-
VersionAdded: 0.49
|
878
|
+
VersionAdded: '0.49'
|
879
879
|
|
880
880
|
Layout/SpaceAfterColon:
|
881
881
|
Description: 'Use spaces after colons.'
|
882
882
|
StyleGuide: '#spaces-operators'
|
883
883
|
Enabled: true
|
884
|
-
VersionAdded: 0.49
|
884
|
+
VersionAdded: '0.49'
|
885
885
|
|
886
886
|
Layout/SpaceAfterComma:
|
887
887
|
Description: 'Use spaces after commas.'
|
888
888
|
StyleGuide: '#spaces-operators'
|
889
889
|
Enabled: true
|
890
|
-
VersionAdded: 0.49
|
890
|
+
VersionAdded: '0.49'
|
891
891
|
|
892
892
|
Layout/SpaceAfterMethodName:
|
893
893
|
Description: >-
|
@@ -895,24 +895,24 @@ Layout/SpaceAfterMethodName:
|
|
895
895
|
parenthesis in a method definition.
|
896
896
|
StyleGuide: '#parens-no-spaces'
|
897
897
|
Enabled: true
|
898
|
-
VersionAdded: 0.49
|
898
|
+
VersionAdded: '0.49'
|
899
899
|
|
900
900
|
Layout/SpaceAfterNot:
|
901
901
|
Description: Tracks redundant space after the ! operator.
|
902
902
|
StyleGuide: '#no-space-bang'
|
903
903
|
Enabled: true
|
904
|
-
VersionAdded: 0.49
|
904
|
+
VersionAdded: '0.49'
|
905
905
|
|
906
906
|
Layout/SpaceAfterSemicolon:
|
907
907
|
Description: 'Use spaces after semicolons.'
|
908
908
|
StyleGuide: '#spaces-operators'
|
909
909
|
Enabled: true
|
910
|
-
VersionAdded: 0.49
|
910
|
+
VersionAdded: '0.49'
|
911
911
|
|
912
912
|
Layout/SpaceAroundBlockParameters:
|
913
913
|
Description: 'Checks the spacing inside and after block parameters pipes.'
|
914
914
|
Enabled: true
|
915
|
-
VersionAdded: 0.49
|
915
|
+
VersionAdded: '0.49'
|
916
916
|
EnforcedStyleInsidePipes: no_space
|
917
917
|
SupportedStylesInsidePipes:
|
918
918
|
- space
|
@@ -925,7 +925,7 @@ Layout/SpaceAroundEqualsInParameterDefault:
|
|
925
925
|
configuration.
|
926
926
|
StyleGuide: '#spaces-around-equals'
|
927
927
|
Enabled: true
|
928
|
-
VersionAdded: 0.49
|
928
|
+
VersionAdded: '0.49'
|
929
929
|
EnforcedStyle: space
|
930
930
|
SupportedStyles:
|
931
931
|
- space
|
@@ -934,13 +934,13 @@ Layout/SpaceAroundEqualsInParameterDefault:
|
|
934
934
|
Layout/SpaceAroundKeyword:
|
935
935
|
Description: 'Use a space around keywords if appropriate.'
|
936
936
|
Enabled: true
|
937
|
-
VersionAdded: 0.49
|
937
|
+
VersionAdded: '0.49'
|
938
938
|
|
939
939
|
Layout/SpaceAroundOperators:
|
940
940
|
Description: 'Use a single space around operators.'
|
941
941
|
StyleGuide: '#spaces-operators'
|
942
942
|
Enabled: true
|
943
|
-
VersionAdded: 0.49
|
943
|
+
VersionAdded: '0.49'
|
944
944
|
# When `true`, allows most uses of extra spacing if the intent is to align
|
945
945
|
# with an operator on the previous or next line, not counting empty lines
|
946
946
|
# or comment lines.
|
@@ -951,7 +951,7 @@ Layout/SpaceBeforeBlockBraces:
|
|
951
951
|
Checks that the left block brace has or doesn't have space
|
952
952
|
before it.
|
953
953
|
Enabled: true
|
954
|
-
VersionAdded: 0.49
|
954
|
+
VersionAdded: '0.49'
|
955
955
|
EnforcedStyle: space
|
956
956
|
SupportedStyles:
|
957
957
|
- space
|
@@ -960,26 +960,26 @@ Layout/SpaceBeforeBlockBraces:
|
|
960
960
|
SupportedStylesForEmptyBraces:
|
961
961
|
- space
|
962
962
|
- no_space
|
963
|
-
VersionChanged: 0.52.1
|
963
|
+
VersionChanged: '0.52.1'
|
964
964
|
|
965
965
|
Layout/SpaceBeforeComma:
|
966
966
|
Description: 'No spaces before commas.'
|
967
967
|
Enabled: true
|
968
|
-
VersionAdded: 0.49
|
968
|
+
VersionAdded: '0.49'
|
969
969
|
|
970
970
|
Layout/SpaceBeforeComment:
|
971
971
|
Description: >-
|
972
972
|
Checks for missing space between code and a comment on the
|
973
973
|
same line.
|
974
974
|
Enabled: true
|
975
|
-
VersionAdded: 0.49
|
975
|
+
VersionAdded: '0.49'
|
976
976
|
|
977
977
|
Layout/SpaceBeforeFirstArg:
|
978
978
|
Description: >-
|
979
979
|
Checks that exactly one space is used between a method name
|
980
980
|
and the first argument for method calls without parentheses.
|
981
981
|
Enabled: true
|
982
|
-
VersionAdded: 0.49
|
982
|
+
VersionAdded: '0.49'
|
983
983
|
# When `true`, allows most uses of extra spacing if the intent is to align
|
984
984
|
# things with the previous or next line, not counting empty lines or comment
|
985
985
|
# lines.
|
@@ -988,12 +988,12 @@ Layout/SpaceBeforeFirstArg:
|
|
988
988
|
Layout/SpaceBeforeSemicolon:
|
989
989
|
Description: 'No spaces before semicolons.'
|
990
990
|
Enabled: true
|
991
|
-
VersionAdded: 0.49
|
991
|
+
VersionAdded: '0.49'
|
992
992
|
|
993
993
|
Layout/SpaceInLambdaLiteral:
|
994
994
|
Description: 'Checks for spaces in lambda literals.'
|
995
995
|
Enabled: true
|
996
|
-
VersionAdded: 0.49
|
996
|
+
VersionAdded: '0.49'
|
997
997
|
EnforcedStyle: require_no_space
|
998
998
|
SupportedStyles:
|
999
999
|
- require_no_space
|
@@ -1002,7 +1002,7 @@ Layout/SpaceInLambdaLiteral:
|
|
1002
1002
|
Layout/SpaceInsideArrayLiteralBrackets:
|
1003
1003
|
Description: 'Checks the spacing inside array literal brackets.'
|
1004
1004
|
Enabled: true
|
1005
|
-
VersionAdded: 0.52
|
1005
|
+
VersionAdded: '0.52'
|
1006
1006
|
EnforcedStyle: no_space
|
1007
1007
|
SupportedStyles:
|
1008
1008
|
- space
|
@@ -1018,7 +1018,7 @@ Layout/SpaceInsideArrayLiteralBrackets:
|
|
1018
1018
|
Layout/SpaceInsideArrayPercentLiteral:
|
1019
1019
|
Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
|
1020
1020
|
Enabled: true
|
1021
|
-
VersionAdded: 0.49
|
1021
|
+
VersionAdded: '0.49'
|
1022
1022
|
|
1023
1023
|
Layout/SpaceInsideBlockBraces:
|
1024
1024
|
Description: >-
|
@@ -1026,7 +1026,7 @@ Layout/SpaceInsideBlockBraces:
|
|
1026
1026
|
For blocks taking parameters, checks that the left brace has
|
1027
1027
|
or doesn't have trailing space.
|
1028
1028
|
Enabled: true
|
1029
|
-
VersionAdded: 0.49
|
1029
|
+
VersionAdded: '0.49'
|
1030
1030
|
EnforcedStyle: space
|
1031
1031
|
SupportedStyles:
|
1032
1032
|
- space
|
@@ -1042,7 +1042,7 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
1042
1042
|
Description: "Use spaces inside hash literal braces - or don't."
|
1043
1043
|
StyleGuide: '#spaces-operators'
|
1044
1044
|
Enabled: true
|
1045
|
-
VersionAdded: 0.49
|
1045
|
+
VersionAdded: '0.49'
|
1046
1046
|
EnforcedStyle: space
|
1047
1047
|
SupportedStyles:
|
1048
1048
|
- space
|
@@ -1060,8 +1060,8 @@ Layout/SpaceInsideParens:
|
|
1060
1060
|
Description: 'No spaces after ( or before ).'
|
1061
1061
|
StyleGuide: '#spaces-braces'
|
1062
1062
|
Enabled: true
|
1063
|
-
VersionAdded: 0.49
|
1064
|
-
VersionChanged: 0.55
|
1063
|
+
VersionAdded: '0.49'
|
1064
|
+
VersionChanged: '0.55'
|
1065
1065
|
EnforcedStyle: no_space
|
1066
1066
|
SupportedStyles:
|
1067
1067
|
- space
|
@@ -1070,19 +1070,19 @@ Layout/SpaceInsideParens:
|
|
1070
1070
|
Layout/SpaceInsidePercentLiteralDelimiters:
|
1071
1071
|
Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
|
1072
1072
|
Enabled: true
|
1073
|
-
VersionAdded: 0.49
|
1073
|
+
VersionAdded: '0.49'
|
1074
1074
|
|
1075
1075
|
Layout/SpaceInsideRangeLiteral:
|
1076
1076
|
Description: 'No spaces inside range literals.'
|
1077
1077
|
StyleGuide: '#no-space-inside-range-literals'
|
1078
1078
|
Enabled: true
|
1079
|
-
VersionAdded: 0.49
|
1079
|
+
VersionAdded: '0.49'
|
1080
1080
|
|
1081
1081
|
Layout/SpaceInsideReferenceBrackets:
|
1082
1082
|
Description: 'Checks the spacing inside referential brackets.'
|
1083
1083
|
Enabled: true
|
1084
|
-
VersionAdded: 0.52
|
1085
|
-
VersionChanged: 0.53
|
1084
|
+
VersionAdded: '0.52'
|
1085
|
+
VersionChanged: '0.53'
|
1086
1086
|
EnforcedStyle: no_space
|
1087
1087
|
SupportedStyles:
|
1088
1088
|
- space
|
@@ -1096,7 +1096,7 @@ Layout/SpaceInsideStringInterpolation:
|
|
1096
1096
|
Description: 'Checks for padding/surrounding spaces inside string interpolation.'
|
1097
1097
|
StyleGuide: '#string-interpolation'
|
1098
1098
|
Enabled: true
|
1099
|
-
VersionAdded: 0.49
|
1099
|
+
VersionAdded: '0.49'
|
1100
1100
|
EnforcedStyle: no_space
|
1101
1101
|
SupportedStyles:
|
1102
1102
|
- space
|
@@ -1106,8 +1106,8 @@ Layout/Tab:
|
|
1106
1106
|
Description: 'No hard tabs.'
|
1107
1107
|
StyleGuide: '#spaces-indentation'
|
1108
1108
|
Enabled: true
|
1109
|
-
VersionAdded: 0.49
|
1110
|
-
VersionChanged: 0.51
|
1109
|
+
VersionAdded: '0.49'
|
1110
|
+
VersionChanged: '0.51'
|
1111
1111
|
# By default, the indentation width from Layout/IndentationWidth is used
|
1112
1112
|
# But it can be overridden by setting this parameter
|
1113
1113
|
# It is used during auto-correction to determine how many spaces should
|
@@ -1118,7 +1118,7 @@ Layout/TrailingBlankLines:
|
|
1118
1118
|
Description: 'Checks trailing blank lines and final newline.'
|
1119
1119
|
StyleGuide: '#newline-eof'
|
1120
1120
|
Enabled: true
|
1121
|
-
VersionAdded: 0.49
|
1121
|
+
VersionAdded: '0.49'
|
1122
1122
|
EnforcedStyle: final_newline
|
1123
1123
|
SupportedStyles:
|
1124
1124
|
- final_newline
|
@@ -1128,8 +1128,8 @@ Layout/TrailingWhitespace:
|
|
1128
1128
|
Description: 'Avoid trailing whitespace.'
|
1129
1129
|
StyleGuide: '#no-trailing-whitespace'
|
1130
1130
|
Enabled: true
|
1131
|
-
VersionAdded: 0.49
|
1132
|
-
VersionChanged: 0.55
|
1131
|
+
VersionAdded: '0.49'
|
1132
|
+
VersionChanged: '0.55'
|
1133
1133
|
AllowInHeredoc: false
|
1134
1134
|
|
1135
1135
|
#################### Lint ##################################
|
@@ -1141,7 +1141,7 @@ Lint/AmbiguousBlockAssociation:
|
|
1141
1141
|
parentheses.
|
1142
1142
|
StyleGuide: '#syntax'
|
1143
1143
|
Enabled: true
|
1144
|
-
VersionAdded: 0.48
|
1144
|
+
VersionAdded: '0.48'
|
1145
1145
|
|
1146
1146
|
Lint/AmbiguousOperator:
|
1147
1147
|
Description: >-
|
@@ -1149,148 +1149,148 @@ Lint/AmbiguousOperator:
|
|
1149
1149
|
method invocation without parentheses.
|
1150
1150
|
StyleGuide: '#method-invocation-parens'
|
1151
1151
|
Enabled: true
|
1152
|
-
VersionAdded: 0.17
|
1152
|
+
VersionAdded: '0.17'
|
1153
1153
|
|
1154
1154
|
Lint/AmbiguousRegexpLiteral:
|
1155
1155
|
Description: >-
|
1156
1156
|
Checks for ambiguous regexp literals in the first argument of
|
1157
1157
|
a method invocation without parentheses.
|
1158
1158
|
Enabled: true
|
1159
|
-
VersionAdded: 0.17
|
1159
|
+
VersionAdded: '0.17'
|
1160
1160
|
|
1161
1161
|
Lint/AssignmentInCondition:
|
1162
1162
|
Description: "Don't use assignment in conditions."
|
1163
1163
|
StyleGuide: '#safe-assignment-in-condition'
|
1164
1164
|
Enabled: true
|
1165
|
-
VersionAdded: 0.9
|
1165
|
+
VersionAdded: '0.9'
|
1166
1166
|
AllowSafeAssignment: true
|
1167
1167
|
|
1168
1168
|
Lint/BigDecimalNew:
|
1169
1169
|
Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
|
1170
1170
|
Enabled: true
|
1171
|
-
VersionAdded: 0.53
|
1171
|
+
VersionAdded: '0.53'
|
1172
1172
|
|
1173
1173
|
Lint/BooleanSymbol:
|
1174
1174
|
Description: 'Check for `:true` and `:false` symbols.'
|
1175
1175
|
Enabled: true
|
1176
|
-
VersionAdded: 0.50
|
1176
|
+
VersionAdded: '0.50'
|
1177
1177
|
|
1178
1178
|
Lint/CircularArgumentReference:
|
1179
1179
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
1180
1180
|
Enabled: true
|
1181
|
-
VersionAdded: 0.33
|
1181
|
+
VersionAdded: '0.33'
|
1182
1182
|
|
1183
1183
|
Lint/Debugger:
|
1184
1184
|
Description: 'Check for debugger calls.'
|
1185
1185
|
Enabled: true
|
1186
|
-
VersionAdded: 0.14
|
1187
|
-
VersionChanged: 0.49
|
1186
|
+
VersionAdded: '0.14'
|
1187
|
+
VersionChanged: '0.49'
|
1188
1188
|
|
1189
1189
|
Lint/DeprecatedClassMethods:
|
1190
1190
|
Description: 'Check for deprecated class method calls.'
|
1191
1191
|
Enabled: true
|
1192
|
-
VersionAdded: 0.19
|
1192
|
+
VersionAdded: '0.19'
|
1193
1193
|
|
1194
1194
|
Lint/DuplicateCaseCondition:
|
1195
1195
|
Description: 'Do not repeat values in case conditionals.'
|
1196
1196
|
Enabled: true
|
1197
|
-
VersionAdded: 0.45
|
1197
|
+
VersionAdded: '0.45'
|
1198
1198
|
|
1199
1199
|
Lint/DuplicateMethods:
|
1200
1200
|
Description: 'Check for duplicate method definitions.'
|
1201
1201
|
Enabled: true
|
1202
|
-
VersionAdded: 0.29
|
1202
|
+
VersionAdded: '0.29'
|
1203
1203
|
|
1204
1204
|
Lint/DuplicatedKey:
|
1205
1205
|
Description: 'Check for duplicate keys in hash literals.'
|
1206
1206
|
Enabled: true
|
1207
|
-
VersionAdded: 0.34
|
1207
|
+
VersionAdded: '0.34'
|
1208
1208
|
|
1209
1209
|
Lint/EachWithObjectArgument:
|
1210
1210
|
Description: 'Check for immutable argument given to each_with_object.'
|
1211
1211
|
Enabled: true
|
1212
|
-
VersionAdded: 0.31
|
1212
|
+
VersionAdded: '0.31'
|
1213
1213
|
|
1214
1214
|
Lint/ElseLayout:
|
1215
1215
|
Description: 'Check for odd code arrangement in an else block.'
|
1216
1216
|
Enabled: true
|
1217
|
-
VersionAdded: 0.17
|
1217
|
+
VersionAdded: '0.17'
|
1218
1218
|
|
1219
1219
|
Lint/EmptyEnsure:
|
1220
1220
|
Description: 'Checks for empty ensure block.'
|
1221
1221
|
Enabled: true
|
1222
|
-
VersionAdded: 0.10
|
1223
|
-
VersionChanged: 0.48
|
1222
|
+
VersionAdded: '0.10'
|
1223
|
+
VersionChanged: '0.48'
|
1224
1224
|
AutoCorrect: false
|
1225
1225
|
|
1226
1226
|
Lint/EmptyExpression:
|
1227
1227
|
Description: 'Checks for empty expressions.'
|
1228
1228
|
Enabled: true
|
1229
|
-
VersionAdded: 0.45
|
1229
|
+
VersionAdded: '0.45'
|
1230
1230
|
|
1231
1231
|
Lint/EmptyInterpolation:
|
1232
1232
|
Description: 'Checks for empty string interpolation.'
|
1233
1233
|
Enabled: true
|
1234
|
-
VersionAdded: 0.20
|
1235
|
-
VersionChanged: 0.45
|
1234
|
+
VersionAdded: '0.20'
|
1235
|
+
VersionChanged: '0.45'
|
1236
1236
|
|
1237
1237
|
Lint/EmptyWhen:
|
1238
1238
|
Description: 'Checks for `when` branches with empty bodies.'
|
1239
1239
|
Enabled: true
|
1240
|
-
VersionAdded: 0.45
|
1240
|
+
VersionAdded: '0.45'
|
1241
1241
|
|
1242
1242
|
Lint/EndInMethod:
|
1243
1243
|
Description: 'END blocks should not be placed inside method definitions.'
|
1244
1244
|
Enabled: true
|
1245
|
-
VersionAdded: 0.9
|
1245
|
+
VersionAdded: '0.9'
|
1246
1246
|
|
1247
1247
|
Lint/EnsureReturn:
|
1248
1248
|
Description: 'Do not use return in an ensure block.'
|
1249
1249
|
StyleGuide: '#no-return-ensure'
|
1250
1250
|
Enabled: true
|
1251
|
-
VersionAdded: 0.9
|
1251
|
+
VersionAdded: '0.9'
|
1252
1252
|
|
1253
1253
|
Lint/ErbNewArguments:
|
1254
1254
|
Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
|
1255
1255
|
Enabled: true
|
1256
|
-
VersionAdded: 0.56
|
1256
|
+
VersionAdded: '0.56'
|
1257
1257
|
|
1258
1258
|
Lint/FloatOutOfRange:
|
1259
1259
|
Description: >-
|
1260
1260
|
Catches floating-point literals too large or small for Ruby to
|
1261
1261
|
represent.
|
1262
1262
|
Enabled: true
|
1263
|
-
VersionAdded: 0.36
|
1263
|
+
VersionAdded: '0.36'
|
1264
1264
|
|
1265
1265
|
Lint/FormatParameterMismatch:
|
1266
1266
|
Description: 'The number of parameters to format/sprint must match the fields.'
|
1267
1267
|
Enabled: true
|
1268
|
-
VersionAdded: 0.33
|
1268
|
+
VersionAdded: '0.33'
|
1269
1269
|
|
1270
1270
|
Lint/HandleExceptions:
|
1271
1271
|
Description: "Don't suppress exception."
|
1272
1272
|
StyleGuide: '#dont-hide-exceptions'
|
1273
1273
|
Enabled: true
|
1274
|
-
VersionAdded: 0.9
|
1274
|
+
VersionAdded: '0.9'
|
1275
1275
|
|
1276
1276
|
Lint/ImplicitStringConcatenation:
|
1277
1277
|
Description: >-
|
1278
1278
|
Checks for adjacent string literals on the same line, which
|
1279
1279
|
could better be represented as a single string literal.
|
1280
1280
|
Enabled: true
|
1281
|
-
VersionAdded: 0.36
|
1281
|
+
VersionAdded: '0.36'
|
1282
1282
|
|
1283
1283
|
Lint/IneffectiveAccessModifier:
|
1284
1284
|
Description: >-
|
1285
1285
|
Checks for attempts to use `private` or `protected` to set
|
1286
1286
|
the visibility of a class method, which does not work.
|
1287
1287
|
Enabled: true
|
1288
|
-
VersionAdded: 0.36
|
1288
|
+
VersionAdded: '0.36'
|
1289
1289
|
|
1290
1290
|
Lint/InheritException:
|
1291
1291
|
Description: 'Avoid inheriting from the `Exception` class.'
|
1292
1292
|
Enabled: true
|
1293
|
-
VersionAdded: 0.41
|
1293
|
+
VersionAdded: '0.41'
|
1294
1294
|
# The default base class in favour of `Exception`.
|
1295
1295
|
EnforcedStyle: runtime_error
|
1296
1296
|
SupportedStyles:
|
@@ -1300,18 +1300,18 @@ Lint/InheritException:
|
|
1300
1300
|
Lint/InterpolationCheck:
|
1301
1301
|
Description: 'Raise warning for interpolation in single q strs'
|
1302
1302
|
Enabled: true
|
1303
|
-
VersionAdded: 0.50
|
1303
|
+
VersionAdded: '0.50'
|
1304
1304
|
|
1305
1305
|
Lint/LiteralAsCondition:
|
1306
1306
|
Description: 'Checks of literals used in conditions.'
|
1307
1307
|
Enabled: true
|
1308
|
-
VersionAdded: 0.51
|
1308
|
+
VersionAdded: '0.51'
|
1309
1309
|
|
1310
1310
|
Lint/LiteralInInterpolation:
|
1311
1311
|
Description: 'Checks for literals used in interpolation.'
|
1312
1312
|
Enabled: true
|
1313
|
-
VersionAdded: 0.19
|
1314
|
-
VersionChanged: 0.32
|
1313
|
+
VersionAdded: '0.19'
|
1314
|
+
VersionChanged: '0.32'
|
1315
1315
|
|
1316
1316
|
Lint/Loop:
|
1317
1317
|
Description: >-
|
@@ -1319,12 +1319,12 @@ Lint/Loop:
|
|
1319
1319
|
begin/end/while for post-loop tests.
|
1320
1320
|
StyleGuide: '#loop-with-break'
|
1321
1321
|
Enabled: true
|
1322
|
-
VersionAdded: 0.9
|
1322
|
+
VersionAdded: '0.9'
|
1323
1323
|
|
1324
1324
|
Lint/MissingCopEnableDirective:
|
1325
1325
|
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`'
|
1326
1326
|
Enabled: true
|
1327
|
-
VersionAdded: 0.52
|
1327
|
+
VersionAdded: '0.52'
|
1328
1328
|
# Maximum number of consecutive lines the cop can be disabled for.
|
1329
1329
|
# 0 allows only single-line disables
|
1330
1330
|
# 1 would mean the maximum allowed is the following:
|
@@ -1337,40 +1337,40 @@ Lint/MissingCopEnableDirective:
|
|
1337
1337
|
Lint/MultipleCompare:
|
1338
1338
|
Description: "Use `&&` operator to compare multiple value."
|
1339
1339
|
Enabled: true
|
1340
|
-
VersionAdded: 0.47
|
1340
|
+
VersionAdded: '0.47'
|
1341
1341
|
|
1342
1342
|
Lint/NestedMethodDefinition:
|
1343
1343
|
Description: 'Do not use nested method definitions.'
|
1344
1344
|
StyleGuide: '#no-nested-methods'
|
1345
1345
|
Enabled: true
|
1346
|
-
VersionAdded: 0.32
|
1346
|
+
VersionAdded: '0.32'
|
1347
1347
|
|
1348
1348
|
Lint/NestedPercentLiteral:
|
1349
1349
|
Description: 'Checks for nested percent literals.'
|
1350
1350
|
Enabled: true
|
1351
|
-
VersionAdded: 0.52
|
1351
|
+
VersionAdded: '0.52'
|
1352
1352
|
|
1353
1353
|
Lint/NextWithoutAccumulator:
|
1354
1354
|
Description: >-
|
1355
1355
|
Do not omit the accumulator when calling `next`
|
1356
1356
|
in a `reduce`/`inject` block.
|
1357
1357
|
Enabled: true
|
1358
|
-
VersionAdded: 0.36
|
1358
|
+
VersionAdded: '0.36'
|
1359
1359
|
|
1360
1360
|
Lint/NonLocalExitFromIterator:
|
1361
1361
|
Description: 'Do not use return in iterator to cause non-local exit.'
|
1362
1362
|
Enabled: true
|
1363
|
-
VersionAdded: 0.30
|
1363
|
+
VersionAdded: '0.30'
|
1364
1364
|
|
1365
1365
|
Lint/NumberConversion:
|
1366
1366
|
Description: 'Checks unsafe usage of number conversion methods.'
|
1367
1367
|
Enabled: false
|
1368
|
-
VersionAdded: 0.53
|
1368
|
+
VersionAdded: '0.53'
|
1369
1369
|
|
1370
1370
|
Lint/OrderedMagicComments:
|
1371
1371
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
1372
1372
|
Enabled: true
|
1373
|
-
VersionAdded: 0.53
|
1373
|
+
VersionAdded: '0.53'
|
1374
1374
|
|
1375
1375
|
Lint/ParenthesesAsGroupedExpression:
|
1376
1376
|
Description: >-
|
@@ -1378,73 +1378,73 @@ Lint/ParenthesesAsGroupedExpression:
|
|
1378
1378
|
parenthesis.
|
1379
1379
|
StyleGuide: '#parens-no-spaces'
|
1380
1380
|
Enabled: true
|
1381
|
-
VersionAdded: 0.12
|
1381
|
+
VersionAdded: '0.12'
|
1382
1382
|
|
1383
1383
|
Lint/PercentStringArray:
|
1384
1384
|
Description: >-
|
1385
1385
|
Checks for unwanted commas and quotes in %w/%W literals.
|
1386
1386
|
Enabled: true
|
1387
|
-
VersionAdded: 0.41
|
1387
|
+
VersionAdded: '0.41'
|
1388
1388
|
|
1389
1389
|
Lint/PercentSymbolArray:
|
1390
1390
|
Description: >-
|
1391
1391
|
Checks for unwanted commas and colons in %i/%I literals.
|
1392
1392
|
Enabled: true
|
1393
|
-
VersionAdded: 0.41
|
1393
|
+
VersionAdded: '0.41'
|
1394
1394
|
|
1395
1395
|
Lint/RandOne:
|
1396
1396
|
Description: >-
|
1397
1397
|
Checks for `rand(1)` calls. Such calls always return `0`
|
1398
1398
|
and most likely a mistake.
|
1399
1399
|
Enabled: true
|
1400
|
-
VersionAdded: 0.36
|
1400
|
+
VersionAdded: '0.36'
|
1401
1401
|
|
1402
1402
|
Lint/RedundantWithIndex:
|
1403
1403
|
Description: 'Checks for redundant `with_index`.'
|
1404
1404
|
Enabled: true
|
1405
|
-
VersionAdded: 0.50
|
1405
|
+
VersionAdded: '0.50'
|
1406
1406
|
|
1407
1407
|
Lint/RedundantWithObject:
|
1408
1408
|
Description: 'Checks for redundant `with_object`.'
|
1409
1409
|
Enabled: true
|
1410
|
-
VersionAdded: 0.51
|
1410
|
+
VersionAdded: '0.51'
|
1411
1411
|
|
1412
1412
|
Lint/RegexpAsCondition:
|
1413
1413
|
Description: >-
|
1414
1414
|
Do not use regexp literal as a condition.
|
1415
1415
|
The regexp literal matches `$_` implicitly.
|
1416
1416
|
Enabled: true
|
1417
|
-
VersionAdded: 0.51
|
1417
|
+
VersionAdded: '0.51'
|
1418
1418
|
|
1419
1419
|
Lint/RequireParentheses:
|
1420
1420
|
Description: >-
|
1421
1421
|
Use parentheses in the method call to avoid confusion
|
1422
1422
|
about precedence.
|
1423
1423
|
Enabled: true
|
1424
|
-
VersionAdded: 0.18
|
1424
|
+
VersionAdded: '0.18'
|
1425
1425
|
|
1426
1426
|
Lint/RescueException:
|
1427
1427
|
Description: 'Avoid rescuing the Exception class.'
|
1428
1428
|
StyleGuide: '#no-blind-rescues'
|
1429
1429
|
Enabled: true
|
1430
|
-
VersionAdded: 0.9
|
1431
|
-
VersionChanged: 0.27.1
|
1430
|
+
VersionAdded: '0.9'
|
1431
|
+
VersionChanged: '0.27.1'
|
1432
1432
|
|
1433
1433
|
Lint/RescueType:
|
1434
1434
|
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
|
1435
1435
|
Enabled: true
|
1436
|
-
VersionAdded: 0.49
|
1436
|
+
VersionAdded: '0.49'
|
1437
1437
|
|
1438
1438
|
Lint/ReturnInVoidContext:
|
1439
1439
|
Description: 'Checks for return in void context.'
|
1440
1440
|
Enabled: true
|
1441
|
-
VersionAdded: 0.50
|
1441
|
+
VersionAdded: '0.50'
|
1442
1442
|
|
1443
1443
|
Lint/SafeNavigationChain:
|
1444
1444
|
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
1445
1445
|
Enabled: true
|
1446
|
-
VersionAdded: 0.47
|
1447
|
-
VersionChanged: 0.56
|
1446
|
+
VersionAdded: '0.47'
|
1447
|
+
VersionChanged: '0.56'
|
1448
1448
|
Whitelist:
|
1449
1449
|
- present?
|
1450
1450
|
- blank?
|
@@ -1458,7 +1458,7 @@ Lint/SafeNavigationConsistency:
|
|
1458
1458
|
call in an `&&` or `||` condition that safe navigation is used
|
1459
1459
|
for all method calls on that same object.
|
1460
1460
|
Enabled: true
|
1461
|
-
VersionAdded: 0.55
|
1461
|
+
VersionAdded: '0.55'
|
1462
1462
|
Whitelist:
|
1463
1463
|
- present?
|
1464
1464
|
- blank?
|
@@ -1470,13 +1470,13 @@ Lint/SafeNavigationConsistency:
|
|
1470
1470
|
Lint/ScriptPermission:
|
1471
1471
|
Description: 'Grant script file execute permission.'
|
1472
1472
|
Enabled: true
|
1473
|
-
VersionAdded: 0.49
|
1474
|
-
VersionChanged: 0.50
|
1473
|
+
VersionAdded: '0.49'
|
1474
|
+
VersionChanged: '0.50'
|
1475
1475
|
|
1476
1476
|
Lint/ShadowedArgument:
|
1477
1477
|
Description: 'Avoid reassigning arguments before they were used.'
|
1478
1478
|
Enabled: true
|
1479
|
-
VersionAdded: 0.52
|
1479
|
+
VersionAdded: '0.52'
|
1480
1480
|
IgnoreImplicitReferences: false
|
1481
1481
|
|
1482
1482
|
|
@@ -1485,37 +1485,37 @@ Lint/ShadowedException:
|
|
1485
1485
|
Avoid rescuing a higher level exception
|
1486
1486
|
before a lower level exception.
|
1487
1487
|
Enabled: true
|
1488
|
-
VersionAdded: 0.41
|
1488
|
+
VersionAdded: '0.41'
|
1489
1489
|
|
1490
1490
|
Lint/ShadowingOuterLocalVariable:
|
1491
1491
|
Description: >-
|
1492
1492
|
Do not use the same name as outer local variable
|
1493
1493
|
for block arguments or block local variables.
|
1494
1494
|
Enabled: true
|
1495
|
-
VersionAdded: 0.9
|
1495
|
+
VersionAdded: '0.9'
|
1496
1496
|
|
1497
1497
|
Lint/StringConversionInInterpolation:
|
1498
1498
|
Description: 'Checks for Object#to_s usage in string interpolation.'
|
1499
1499
|
StyleGuide: '#no-to-s'
|
1500
1500
|
Enabled: true
|
1501
|
-
VersionAdded: 0.19
|
1502
|
-
VersionChanged: 0.20
|
1501
|
+
VersionAdded: '0.19'
|
1502
|
+
VersionChanged: '0.20'
|
1503
1503
|
|
1504
1504
|
Lint/Syntax:
|
1505
1505
|
Description: 'Checks syntax error'
|
1506
1506
|
Enabled: true
|
1507
|
-
VersionAdded: 0.9
|
1507
|
+
VersionAdded: '0.9'
|
1508
1508
|
|
1509
1509
|
|
1510
1510
|
Lint/UnderscorePrefixedVariableName:
|
1511
1511
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
1512
1512
|
Enabled: true
|
1513
|
-
VersionAdded: 0.21
|
1513
|
+
VersionAdded: '0.21'
|
1514
1514
|
|
1515
1515
|
Lint/UnifiedInteger:
|
1516
1516
|
Description: 'Use Integer instead of Fixnum or Bignum'
|
1517
1517
|
Enabled: true
|
1518
|
-
VersionAdded: 0.43
|
1518
|
+
VersionAdded: '0.43'
|
1519
1519
|
|
1520
1520
|
Lint/UnneededCopDisableDirective:
|
1521
1521
|
Description: >-
|
@@ -1523,34 +1523,34 @@ Lint/UnneededCopDisableDirective:
|
|
1523
1523
|
Note: this cop is not disabled when disabling all cops.
|
1524
1524
|
It must be explicitly disabled.
|
1525
1525
|
Enabled: true
|
1526
|
-
VersionAdded: 0.53
|
1526
|
+
VersionAdded: '0.53'
|
1527
1527
|
|
1528
1528
|
Lint/UnneededCopEnableDirective:
|
1529
1529
|
Description: Checks for rubocop:enable comments that can be removed.
|
1530
1530
|
Enabled: true
|
1531
|
-
VersionAdded: 0.53
|
1531
|
+
VersionAdded: '0.53'
|
1532
1532
|
|
1533
1533
|
Lint/UnneededRequireStatement:
|
1534
1534
|
Description: 'Checks for unnecessary `require` statement.'
|
1535
1535
|
Enabled: true
|
1536
|
-
VersionAdded: 0.51
|
1536
|
+
VersionAdded: '0.51'
|
1537
1537
|
|
1538
1538
|
Lint/UnneededSplatExpansion:
|
1539
1539
|
Description: 'Checks for splat unnecessarily being called on literals'
|
1540
1540
|
Enabled: true
|
1541
|
-
VersionAdded: 0.43
|
1541
|
+
VersionAdded: '0.43'
|
1542
1542
|
|
1543
1543
|
Lint/UnreachableCode:
|
1544
1544
|
Description: 'Unreachable code.'
|
1545
1545
|
Enabled: true
|
1546
|
-
VersionAdded: 0.9
|
1546
|
+
VersionAdded: '0.9'
|
1547
1547
|
|
1548
1548
|
Lint/UnusedBlockArgument:
|
1549
1549
|
Description: 'Checks for unused block arguments.'
|
1550
1550
|
StyleGuide: '#underscore-unused-vars'
|
1551
1551
|
Enabled: true
|
1552
|
-
VersionAdded: 0.21
|
1553
|
-
VersionChanged: 0.22
|
1552
|
+
VersionAdded: '0.21'
|
1553
|
+
VersionChanged: '0.22'
|
1554
1554
|
IgnoreEmptyBlocks: true
|
1555
1555
|
AllowUnusedKeywordArguments: false
|
1556
1556
|
|
@@ -1558,8 +1558,8 @@ Lint/UnusedMethodArgument:
|
|
1558
1558
|
Description: 'Checks for unused method arguments.'
|
1559
1559
|
StyleGuide: '#underscore-unused-vars'
|
1560
1560
|
Enabled: true
|
1561
|
-
VersionAdded: 0.21
|
1562
|
-
VersionChanged: 0.35
|
1561
|
+
VersionAdded: '0.21'
|
1562
|
+
VersionChanged: '0.35'
|
1563
1563
|
AllowUnusedKeywordArguments: false
|
1564
1564
|
IgnoreEmptyMethods: true
|
1565
1565
|
|
@@ -1572,18 +1572,18 @@ Lint/UriEscapeUnescape:
|
|
1572
1572
|
`CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
|
1573
1573
|
depending on your specific use case.
|
1574
1574
|
Enabled: true
|
1575
|
-
VersionAdded: 0.50
|
1575
|
+
VersionAdded: '0.50'
|
1576
1576
|
|
1577
1577
|
Lint/UriRegexp:
|
1578
1578
|
Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.'
|
1579
1579
|
Enabled: true
|
1580
|
-
VersionAdded: 0.50
|
1580
|
+
VersionAdded: '0.50'
|
1581
1581
|
|
1582
1582
|
Lint/UselessAccessModifier:
|
1583
1583
|
Description: 'Checks for useless access modifiers.'
|
1584
1584
|
Enabled: true
|
1585
|
-
VersionAdded: 0.20
|
1586
|
-
VersionChanged: 0.47
|
1585
|
+
VersionAdded: '0.20'
|
1586
|
+
VersionChanged: '0.47'
|
1587
1587
|
ContextCreatingMethods: []
|
1588
1588
|
MethodCreatingMethods: []
|
1589
1589
|
|
@@ -1591,27 +1591,27 @@ Lint/UselessAssignment:
|
|
1591
1591
|
Description: 'Checks for useless assignment to a local variable.'
|
1592
1592
|
StyleGuide: '#underscore-unused-vars'
|
1593
1593
|
Enabled: true
|
1594
|
-
VersionAdded: 0.11
|
1594
|
+
VersionAdded: '0.11'
|
1595
1595
|
|
1596
1596
|
Lint/UselessComparison:
|
1597
1597
|
Description: 'Checks for comparison of something with itself.'
|
1598
1598
|
Enabled: true
|
1599
|
-
VersionAdded: 0.11
|
1599
|
+
VersionAdded: '0.11'
|
1600
1600
|
|
1601
1601
|
Lint/UselessElseWithoutRescue:
|
1602
1602
|
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
1603
1603
|
Enabled: true
|
1604
|
-
VersionAdded: 0.17
|
1604
|
+
VersionAdded: '0.17'
|
1605
1605
|
|
1606
1606
|
Lint/UselessSetterCall:
|
1607
1607
|
Description: 'Checks for useless setter call to a local variable.'
|
1608
1608
|
Enabled: true
|
1609
|
-
VersionAdded: 0.13
|
1609
|
+
VersionAdded: '0.13'
|
1610
1610
|
|
1611
1611
|
Lint/Void:
|
1612
1612
|
Description: 'Possible use of operator/literal/variable in void context.'
|
1613
1613
|
Enabled: true
|
1614
|
-
VersionAdded: 0.9
|
1614
|
+
VersionAdded: '0.9'
|
1615
1615
|
CheckForMethodsWithNoSideEffects: false
|
1616
1616
|
|
1617
1617
|
#################### Metrics ###############################
|
@@ -1622,7 +1622,7 @@ Metrics/AbcSize:
|
|
1622
1622
|
branches, and conditions.
|
1623
1623
|
Reference: 'http://c2.com/cgi/wiki?AbcMetric'
|
1624
1624
|
Enabled: true
|
1625
|
-
VersionAdded: 0.27
|
1625
|
+
VersionAdded: '0.27'
|
1626
1626
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
1627
1627
|
# a Float.
|
1628
1628
|
Max: 15
|
@@ -1630,8 +1630,8 @@ Metrics/AbcSize:
|
|
1630
1630
|
Metrics/BlockLength:
|
1631
1631
|
Description: 'Avoid long blocks with many lines.'
|
1632
1632
|
Enabled: true
|
1633
|
-
VersionAdded: 0.44
|
1634
|
-
VersionChanged: 0.58
|
1633
|
+
VersionAdded: '0.44'
|
1634
|
+
VersionChanged: '0.58'
|
1635
1635
|
CountComments: false # count full line comments?
|
1636
1636
|
Max: 25
|
1637
1637
|
ExcludedMethods:
|
@@ -1643,15 +1643,15 @@ Metrics/BlockNesting:
|
|
1643
1643
|
Description: 'Avoid excessive block nesting'
|
1644
1644
|
StyleGuide: '#three-is-the-number-thou-shalt-count'
|
1645
1645
|
Enabled: true
|
1646
|
-
VersionAdded: 0.25
|
1647
|
-
VersionChanged: 0.47
|
1646
|
+
VersionAdded: '0.25'
|
1647
|
+
VersionChanged: '0.47'
|
1648
1648
|
CountBlocks: false
|
1649
1649
|
Max: 3
|
1650
1650
|
|
1651
1651
|
Metrics/ClassLength:
|
1652
1652
|
Description: 'Avoid classes longer than 100 lines of code.'
|
1653
1653
|
Enabled: true
|
1654
|
-
VersionAdded: 0.25
|
1654
|
+
VersionAdded: '0.25'
|
1655
1655
|
CountComments: false # count full line comments?
|
1656
1656
|
Max: 100
|
1657
1657
|
|
@@ -1661,15 +1661,15 @@ Metrics/CyclomaticComplexity:
|
|
1661
1661
|
A complexity metric that is strongly correlated to the number
|
1662
1662
|
of test cases needed to validate a method.
|
1663
1663
|
Enabled: true
|
1664
|
-
VersionAdded: 0.25
|
1664
|
+
VersionAdded: '0.25'
|
1665
1665
|
Max: 6
|
1666
1666
|
|
1667
1667
|
Metrics/LineLength:
|
1668
1668
|
Description: 'Limit lines to 80 characters.'
|
1669
1669
|
StyleGuide: '#80-character-limits'
|
1670
1670
|
Enabled: true
|
1671
|
-
VersionAdded: 0.25
|
1672
|
-
VersionChanged: 0.46
|
1671
|
+
VersionAdded: '0.25'
|
1672
|
+
VersionChanged: '0.46'
|
1673
1673
|
Max: 80
|
1674
1674
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
1675
1675
|
# containing a URI to be longer than Max.
|
@@ -1690,8 +1690,8 @@ Metrics/MethodLength:
|
|
1690
1690
|
Description: 'Avoid methods longer than 10 lines of code.'
|
1691
1691
|
StyleGuide: '#short-methods'
|
1692
1692
|
Enabled: true
|
1693
|
-
VersionAdded: 0.25
|
1694
|
-
VersionChanged: 0.59.2
|
1693
|
+
VersionAdded: '0.25'
|
1694
|
+
VersionChanged: '0.59.2'
|
1695
1695
|
CountComments: false # count full line comments?
|
1696
1696
|
Max: 10
|
1697
1697
|
ExcludedMethods: []
|
@@ -1699,7 +1699,7 @@ Metrics/MethodLength:
|
|
1699
1699
|
Metrics/ModuleLength:
|
1700
1700
|
Description: 'Avoid modules longer than 100 lines of code.'
|
1701
1701
|
Enabled: true
|
1702
|
-
VersionAdded: 0.31
|
1702
|
+
VersionAdded: '0.31'
|
1703
1703
|
CountComments: false # count full line comments?
|
1704
1704
|
Max: 100
|
1705
1705
|
|
@@ -1707,7 +1707,7 @@ Metrics/ParameterLists:
|
|
1707
1707
|
Description: 'Avoid parameter lists longer than three or four parameters.'
|
1708
1708
|
StyleGuide: '#too-many-params'
|
1709
1709
|
Enabled: true
|
1710
|
-
VersionAdded: 0.25
|
1710
|
+
VersionAdded: '0.25'
|
1711
1711
|
Max: 5
|
1712
1712
|
CountKeywordArgs: true
|
1713
1713
|
|
@@ -1716,7 +1716,7 @@ Metrics/PerceivedComplexity:
|
|
1716
1716
|
A complexity metric geared towards measuring complexity for a
|
1717
1717
|
human reader.
|
1718
1718
|
Enabled: true
|
1719
|
-
VersionAdded: 0.25
|
1719
|
+
VersionAdded: '0.25'
|
1720
1720
|
Max: 7
|
1721
1721
|
|
1722
1722
|
#################### Naming ##############################
|
@@ -1725,37 +1725,37 @@ Naming/AccessorMethodName:
|
|
1725
1725
|
Description: Check the naming of accessor methods for get_/set_.
|
1726
1726
|
StyleGuide: '#accessor_mutator_method_names'
|
1727
1727
|
Enabled: true
|
1728
|
-
VersionAdded: 0.50
|
1728
|
+
VersionAdded: '0.50'
|
1729
1729
|
|
1730
1730
|
Naming/AsciiIdentifiers:
|
1731
1731
|
Description: 'Use only ascii symbols in identifiers.'
|
1732
1732
|
StyleGuide: '#english-identifiers'
|
1733
1733
|
Enabled: true
|
1734
|
-
VersionAdded: 0.50
|
1734
|
+
VersionAdded: '0.50'
|
1735
1735
|
|
1736
1736
|
Naming/BinaryOperatorParameterName:
|
1737
1737
|
Description: 'When defining binary operators, name the argument other.'
|
1738
1738
|
StyleGuide: '#other-arg'
|
1739
1739
|
Enabled: true
|
1740
|
-
VersionAdded: 0.50
|
1740
|
+
VersionAdded: '0.50'
|
1741
1741
|
|
1742
1742
|
Naming/ClassAndModuleCamelCase:
|
1743
1743
|
Description: 'Use CamelCase for classes and modules.'
|
1744
1744
|
StyleGuide: '#camelcase-classes'
|
1745
1745
|
Enabled: true
|
1746
|
-
VersionAdded: 0.50
|
1746
|
+
VersionAdded: '0.50'
|
1747
1747
|
|
1748
1748
|
Naming/ConstantName:
|
1749
1749
|
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
1750
1750
|
StyleGuide: '#screaming-snake-case'
|
1751
1751
|
Enabled: true
|
1752
|
-
VersionAdded: 0.50
|
1752
|
+
VersionAdded: '0.50'
|
1753
1753
|
|
1754
1754
|
Naming/FileName:
|
1755
1755
|
Description: 'Use snake_case for source file names.'
|
1756
1756
|
StyleGuide: '#snake-case-files'
|
1757
1757
|
Enabled: true
|
1758
|
-
VersionAdded: 0.50
|
1758
|
+
VersionAdded: '0.50'
|
1759
1759
|
# Camel case file names listed in `AllCops:Include` and all file names listed
|
1760
1760
|
# in `AllCops:Exclude` are excluded by default. Add extra excludes here.
|
1761
1761
|
Exclude: []
|
@@ -1819,7 +1819,7 @@ Naming/HeredocDelimiterCase:
|
|
1819
1819
|
Description: 'Use configured case for heredoc delimiters.'
|
1820
1820
|
StyleGuide: '#heredoc-delimiters'
|
1821
1821
|
Enabled: true
|
1822
|
-
VersionAdded: 0.50
|
1822
|
+
VersionAdded: '0.50'
|
1823
1823
|
EnforcedStyle: uppercase
|
1824
1824
|
SupportedStyles:
|
1825
1825
|
- lowercase
|
@@ -1829,7 +1829,7 @@ Naming/HeredocDelimiterNaming:
|
|
1829
1829
|
Description: 'Use descriptive heredoc delimiters.'
|
1830
1830
|
StyleGuide: '#heredoc-delimiters'
|
1831
1831
|
Enabled: true
|
1832
|
-
VersionAdded: 0.50
|
1832
|
+
VersionAdded: '0.50'
|
1833
1833
|
Blacklist:
|
1834
1834
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
1835
1835
|
|
@@ -1837,8 +1837,8 @@ Naming/MemoizedInstanceVariableName:
|
|
1837
1837
|
Description: >-
|
1838
1838
|
Memoized method name should match memo instance variable name.
|
1839
1839
|
Enabled: true
|
1840
|
-
VersionAdded: 0.53
|
1841
|
-
VersionChanged: 0.58
|
1840
|
+
VersionAdded: '0.53'
|
1841
|
+
VersionChanged: '0.58'
|
1842
1842
|
EnforcedStyleForLeadingUnderscores: disallowed
|
1843
1843
|
SupportedStylesForLeadingUnderscores:
|
1844
1844
|
- disallowed
|
@@ -1849,7 +1849,7 @@ Naming/MethodName:
|
|
1849
1849
|
Description: 'Use the configured style when naming methods.'
|
1850
1850
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
1851
1851
|
Enabled: true
|
1852
|
-
VersionAdded: 0.50
|
1852
|
+
VersionAdded: '0.50'
|
1853
1853
|
EnforcedStyle: snake_case
|
1854
1854
|
SupportedStyles:
|
1855
1855
|
- snake_case
|
@@ -1859,8 +1859,8 @@ Naming/PredicateName:
|
|
1859
1859
|
Description: 'Check the names of predicate methods.'
|
1860
1860
|
StyleGuide: '#bool-methods-qmark'
|
1861
1861
|
Enabled: true
|
1862
|
-
VersionAdded: 0.50
|
1863
|
-
VersionChanged: 0.51
|
1862
|
+
VersionAdded: '0.50'
|
1863
|
+
VersionChanged: '0.51'
|
1864
1864
|
# Predicate name prefixes.
|
1865
1865
|
NamePrefix:
|
1866
1866
|
- is_
|
@@ -1889,7 +1889,7 @@ Naming/UncommunicativeBlockParamName:
|
|
1889
1889
|
Checks for block parameter names that contain capital letters,
|
1890
1890
|
end in numbers, or do not meet a minimal length.
|
1891
1891
|
Enabled: true
|
1892
|
-
VersionAdded: 0.53
|
1892
|
+
VersionAdded: '0.53'
|
1893
1893
|
# Parameter names may be equal to or greater than this value
|
1894
1894
|
MinNameLength: 1
|
1895
1895
|
AllowNamesEndingInNumbers: true
|
@@ -1903,8 +1903,8 @@ Naming/UncommunicativeMethodParamName:
|
|
1903
1903
|
Checks for method parameter names that contain capital letters,
|
1904
1904
|
end in numbers, or do not meet a minimal length.
|
1905
1905
|
Enabled: true
|
1906
|
-
VersionAdded: 0.53
|
1907
|
-
VersionChanged: 0.59
|
1906
|
+
VersionAdded: '0.53'
|
1907
|
+
VersionChanged: '0.59'
|
1908
1908
|
# Parameter names may be equal to or greater than this value
|
1909
1909
|
MinNameLength: 3
|
1910
1910
|
AllowNamesEndingInNumbers: true
|
@@ -1927,7 +1927,7 @@ Naming/VariableName:
|
|
1927
1927
|
Description: 'Use the configured style when naming variables.'
|
1928
1928
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
1929
1929
|
Enabled: true
|
1930
|
-
VersionAdded: 0.50
|
1930
|
+
VersionAdded: '0.50'
|
1931
1931
|
EnforcedStyle: snake_case
|
1932
1932
|
SupportedStyles:
|
1933
1933
|
- snake_case
|
@@ -1936,7 +1936,7 @@ Naming/VariableName:
|
|
1936
1936
|
Naming/VariableNumber:
|
1937
1937
|
Description: 'Use the configured style when numbering variables.'
|
1938
1938
|
Enabled: true
|
1939
|
-
VersionAdded: 0.50
|
1939
|
+
VersionAdded: '0.50'
|
1940
1940
|
EnforcedStyle: normalcase
|
1941
1941
|
SupportedStyles:
|
1942
1942
|
- snake_case
|
@@ -1949,7 +1949,7 @@ Performance/Caller:
|
|
1949
1949
|
Description: >-
|
1950
1950
|
Use `caller(n..n)` instead of `caller`.
|
1951
1951
|
Enabled: true
|
1952
|
-
VersionAdded: 0.49
|
1952
|
+
VersionAdded: '0.49'
|
1953
1953
|
|
1954
1954
|
Performance/CaseWhenSplat:
|
1955
1955
|
Description: >-
|
@@ -1958,15 +1958,15 @@ Performance/CaseWhenSplat:
|
|
1958
1958
|
Enabled: false
|
1959
1959
|
AutoCorrect: false
|
1960
1960
|
SafeAutoCorrect: false
|
1961
|
-
VersionAdded: 0.34
|
1962
|
-
VersionChanged: 0.59
|
1961
|
+
VersionAdded: '0.34'
|
1962
|
+
VersionChanged: '0.59'
|
1963
1963
|
|
1964
1964
|
Performance/Casecmp:
|
1965
1965
|
Description: >-
|
1966
1966
|
Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
|
1967
1967
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
|
1968
1968
|
Enabled: true
|
1969
|
-
VersionAdded: 0.36
|
1969
|
+
VersionAdded: '0.36'
|
1970
1970
|
|
1971
1971
|
Performance/ChainArrayAllocation:
|
1972
1972
|
Description: >-
|
@@ -1974,12 +1974,12 @@ Performance/ChainArrayAllocation:
|
|
1974
1974
|
existing array.
|
1975
1975
|
Reference: 'https://twitter.com/schneems/status/1034123879978029057'
|
1976
1976
|
Enabled: false
|
1977
|
-
VersionAdded: 0.59
|
1977
|
+
VersionAdded: '0.59'
|
1978
1978
|
|
1979
1979
|
Performance/CompareWithBlock:
|
1980
1980
|
Description: 'Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.'
|
1981
1981
|
Enabled: true
|
1982
|
-
VersionAdded: 0.46
|
1982
|
+
VersionAdded: '0.46'
|
1983
1983
|
|
1984
1984
|
Performance/Count:
|
1985
1985
|
Description: >-
|
@@ -1992,8 +1992,8 @@ Performance/Count:
|
|
1992
1992
|
# If you understand the known risk, you can disable `SafeMode`.
|
1993
1993
|
SafeMode: true
|
1994
1994
|
Enabled: true
|
1995
|
-
VersionAdded: 0.31
|
1996
|
-
VersionChanged: 0.39
|
1995
|
+
VersionAdded: '0.31'
|
1996
|
+
VersionChanged: '0.39'
|
1997
1997
|
|
1998
1998
|
Performance/Detect:
|
1999
1999
|
Description: >-
|
@@ -2006,16 +2006,16 @@ Performance/Detect:
|
|
2006
2006
|
# should be considered unsafe.
|
2007
2007
|
SafeMode: true
|
2008
2008
|
Enabled: true
|
2009
|
-
VersionAdded: 0.30
|
2010
|
-
VersionChanged: 0.39
|
2009
|
+
VersionAdded: '0.30'
|
2010
|
+
VersionChanged: '0.39'
|
2011
2011
|
|
2012
2012
|
Performance/DoubleStartEndWith:
|
2013
2013
|
Description: >-
|
2014
2014
|
Use `str.{start,end}_with?(x, ..., y, ...)`
|
2015
2015
|
instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
|
2016
2016
|
Enabled: true
|
2017
|
-
VersionAdded: 0.36
|
2018
|
-
VersionChanged: 0.48
|
2017
|
+
VersionAdded: '0.36'
|
2018
|
+
VersionChanged: '0.48'
|
2019
2019
|
# Used to check for `starts_with?` and `ends_with?`.
|
2020
2020
|
# These methods are defined by `ActiveSupport`.
|
2021
2021
|
IncludeActiveSupportAliases: false
|
@@ -2029,13 +2029,13 @@ Performance/EndWith:
|
|
2029
2029
|
SafeAutoCorrect: false
|
2030
2030
|
AutoCorrect: false
|
2031
2031
|
Enabled: true
|
2032
|
-
VersionAdded: 0.36
|
2033
|
-
VersionChanged: 0.44
|
2032
|
+
VersionAdded: '0.36'
|
2033
|
+
VersionChanged: '0.44'
|
2034
2034
|
|
2035
2035
|
Performance/FixedSize:
|
2036
2036
|
Description: 'Do not compute the size of statically sized objects except in constants'
|
2037
2037
|
Enabled: true
|
2038
|
-
VersionAdded: 0.35
|
2038
|
+
VersionAdded: '0.35'
|
2039
2039
|
|
2040
2040
|
Performance/FlatMap:
|
2041
2041
|
Description: >-
|
@@ -2044,7 +2044,7 @@ Performance/FlatMap:
|
|
2044
2044
|
or `Enumberable#collect..Array#flatten(1)`
|
2045
2045
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
2046
2046
|
Enabled: true
|
2047
|
-
VersionAdded: 0.30
|
2047
|
+
VersionAdded: '0.30'
|
2048
2048
|
EnabledForFlattenWithoutParams: false
|
2049
2049
|
# If enabled, this cop will warn about usages of
|
2050
2050
|
# `flatten` being called without any parameters.
|
@@ -2055,45 +2055,51 @@ Performance/InefficientHashSearch:
|
|
2055
2055
|
Description: 'Use `key?` or `value?` instead of `keys.include?` or `values.include?`'
|
2056
2056
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashkey-instead-of-hashkeysinclude-code'
|
2057
2057
|
Enabled: true
|
2058
|
-
VersionAdded: 0.56
|
2058
|
+
VersionAdded: '0.56'
|
2059
2059
|
Safe: false
|
2060
2060
|
|
2061
2061
|
Performance/LstripRstrip:
|
2062
2062
|
Description: 'Use `strip` instead of `lstrip.rstrip`.'
|
2063
2063
|
Enabled: true
|
2064
|
-
VersionAdded: 0.36
|
2064
|
+
VersionAdded: '0.36'
|
2065
|
+
|
2066
|
+
Performance/OpenStruct:
|
2067
|
+
Description: 'Use `Struct` instead of `OpenStruct`.'
|
2068
|
+
Enabled: false
|
2069
|
+
VersionAdded: '0.61'
|
2070
|
+
Safe: false
|
2065
2071
|
|
2066
2072
|
Performance/RangeInclude:
|
2067
2073
|
Description: 'Use `Range#cover?` instead of `Range#include?`.'
|
2068
2074
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
|
2069
2075
|
Enabled: true
|
2070
|
-
VersionAdded: 0.36
|
2076
|
+
VersionAdded: '0.36'
|
2071
2077
|
|
2072
2078
|
Performance/RedundantBlockCall:
|
2073
2079
|
Description: 'Use `yield` instead of `block.call`.'
|
2074
2080
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode'
|
2075
2081
|
Enabled: true
|
2076
|
-
VersionAdded: 0.36
|
2082
|
+
VersionAdded: '0.36'
|
2077
2083
|
|
2078
2084
|
Performance/RedundantMatch:
|
2079
2085
|
Description: >-
|
2080
2086
|
Use `=~` instead of `String#match` or `Regexp#match` in a context where the
|
2081
2087
|
returned `MatchData` is not needed.
|
2082
2088
|
Enabled: true
|
2083
|
-
VersionAdded: 0.36
|
2089
|
+
VersionAdded: '0.36'
|
2084
2090
|
|
2085
2091
|
Performance/RedundantMerge:
|
2086
2092
|
Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
|
2087
2093
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
|
2088
2094
|
Enabled: true
|
2089
|
-
VersionAdded: 0.36
|
2095
|
+
VersionAdded: '0.36'
|
2090
2096
|
# Max number of key-value pairs to consider an offense
|
2091
2097
|
MaxKeyValuePairs: 2
|
2092
2098
|
|
2093
2099
|
Performance/RedundantSortBy:
|
2094
2100
|
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
|
2095
2101
|
Enabled: true
|
2096
|
-
VersionAdded: 0.36
|
2102
|
+
VersionAdded: '0.36'
|
2097
2103
|
|
2098
2104
|
Performance/RegexpMatch:
|
2099
2105
|
Description: >-
|
@@ -2101,13 +2107,13 @@ Performance/RegexpMatch:
|
|
2101
2107
|
`Regexp#===`, or `=~` when `MatchData` is not used.
|
2102
2108
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#regexp-vs-stringmatch-vs-string-vs-stringmatch-code-'
|
2103
2109
|
Enabled: true
|
2104
|
-
VersionAdded: 0.47
|
2110
|
+
VersionAdded: '0.47'
|
2105
2111
|
|
2106
2112
|
Performance/ReverseEach:
|
2107
2113
|
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
2108
2114
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
2109
2115
|
Enabled: true
|
2110
|
-
VersionAdded: 0.30
|
2116
|
+
VersionAdded: '0.30'
|
2111
2117
|
|
2112
2118
|
Performance/Sample:
|
2113
2119
|
Description: >-
|
@@ -2115,7 +2121,7 @@ Performance/Sample:
|
|
2115
2121
|
`shuffle.last`, and `shuffle[Integer]`.
|
2116
2122
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
2117
2123
|
Enabled: true
|
2118
|
-
VersionAdded: 0.30
|
2124
|
+
VersionAdded: '0.30'
|
2119
2125
|
|
2120
2126
|
Performance/Size:
|
2121
2127
|
Description: >-
|
@@ -2123,7 +2129,7 @@ Performance/Size:
|
|
2123
2129
|
the number of elements in `Array` and `Hash`.
|
2124
2130
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code'
|
2125
2131
|
Enabled: true
|
2126
|
-
VersionAdded: 0.30
|
2132
|
+
VersionAdded: '0.30'
|
2127
2133
|
|
2128
2134
|
Performance/StartWith:
|
2129
2135
|
Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
|
@@ -2134,8 +2140,8 @@ Performance/StartWith:
|
|
2134
2140
|
SafeAutoCorrect: false
|
2135
2141
|
AutoCorrect: false
|
2136
2142
|
Enabled: true
|
2137
|
-
VersionAdded: 0.36
|
2138
|
-
VersionChanged: 0.44
|
2143
|
+
VersionAdded: '0.36'
|
2144
|
+
VersionChanged: '0.44'
|
2139
2145
|
|
2140
2146
|
Performance/StringReplacement:
|
2141
2147
|
Description: >-
|
@@ -2144,32 +2150,32 @@ Performance/StringReplacement:
|
|
2144
2150
|
you are deleting characters.
|
2145
2151
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
2146
2152
|
Enabled: true
|
2147
|
-
VersionAdded: 0.33
|
2153
|
+
VersionAdded: '0.33'
|
2148
2154
|
|
2149
2155
|
Performance/TimesMap:
|
2150
2156
|
Description: 'Checks for .times.map calls.'
|
2151
2157
|
AutoCorrect: false
|
2152
2158
|
Enabled: true
|
2153
|
-
VersionAdded: 0.36
|
2154
|
-
VersionChanged: 0.50
|
2159
|
+
VersionAdded: '0.36'
|
2160
|
+
VersionChanged: '0.50'
|
2155
2161
|
SafeAutoCorrect: false # see https://github.com/rubocop-hq/rubocop/issues/4658
|
2156
2162
|
|
2157
2163
|
Performance/UnfreezeString:
|
2158
2164
|
Description: 'Use unary plus to get an unfrozen string literal.'
|
2159
2165
|
Enabled: true
|
2160
|
-
VersionAdded: 0.50
|
2166
|
+
VersionAdded: '0.50'
|
2161
2167
|
|
2162
2168
|
Performance/UnneededSort:
|
2163
2169
|
Description: >-
|
2164
2170
|
Use `min` instead of `sort.first`,
|
2165
2171
|
`max_by` instead of `sort_by...last`, etc.
|
2166
2172
|
Enabled: true
|
2167
|
-
VersionAdded: 0.55
|
2173
|
+
VersionAdded: '0.55'
|
2168
2174
|
|
2169
2175
|
Performance/UriDefaultParser:
|
2170
2176
|
Description: 'Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.'
|
2171
2177
|
Enabled: true
|
2172
|
-
VersionAdded: 0.50
|
2178
|
+
VersionAdded: '0.50'
|
2173
2179
|
|
2174
2180
|
#################### Rails #################################
|
2175
2181
|
|
@@ -2181,7 +2187,7 @@ Rails:
|
|
2181
2187
|
Rails/ActionFilter:
|
2182
2188
|
Description: 'Enforces consistent use of action filter methods.'
|
2183
2189
|
Enabled: true
|
2184
|
-
VersionAdded: 0.19
|
2190
|
+
VersionAdded: '0.19'
|
2185
2191
|
EnforcedStyle: action
|
2186
2192
|
SupportedStyles:
|
2187
2193
|
- action
|
@@ -2195,7 +2201,7 @@ Rails/ActiveRecordAliases:
|
|
2195
2201
|
Use `update` instead of `update_attributes`.
|
2196
2202
|
Use `update!` instead of `update_attributes!`.
|
2197
2203
|
Enabled: true
|
2198
|
-
VersionAdded: 0.53
|
2204
|
+
VersionAdded: '0.53'
|
2199
2205
|
|
2200
2206
|
Rails/ActiveSupportAliases:
|
2201
2207
|
Description: >-
|
@@ -2203,29 +2209,29 @@ Rails/ActiveSupportAliases:
|
|
2203
2209
|
`String#starts_with?`, `String#ends_with?`,
|
2204
2210
|
`Array#append`, `Array#prepend`.
|
2205
2211
|
Enabled: true
|
2206
|
-
VersionAdded: 0.48
|
2212
|
+
VersionAdded: '0.48'
|
2207
2213
|
|
2208
2214
|
Rails/ApplicationJob:
|
2209
2215
|
Description: 'Check that jobs subclass ApplicationJob.'
|
2210
2216
|
Enabled: true
|
2211
|
-
VersionAdded: 0.49
|
2217
|
+
VersionAdded: '0.49'
|
2212
2218
|
|
2213
2219
|
Rails/ApplicationRecord:
|
2214
2220
|
Description: 'Check that models subclass ApplicationRecord.'
|
2215
2221
|
Enabled: true
|
2216
|
-
VersionAdded: 0.49
|
2222
|
+
VersionAdded: '0.49'
|
2217
2223
|
|
2218
2224
|
Rails/AssertNot:
|
2219
2225
|
Description: 'Use `assert_not` instead of `assert !`.'
|
2220
2226
|
Enabled: true
|
2221
|
-
VersionAdded: 0.56
|
2227
|
+
VersionAdded: '0.56'
|
2222
2228
|
Include:
|
2223
2229
|
- '**/test/**/*'
|
2224
2230
|
|
2225
2231
|
Rails/Blank:
|
2226
2232
|
Description: 'Enforces use of `blank?`.'
|
2227
2233
|
Enabled: true
|
2228
|
-
VersionAdded: 0.48
|
2234
|
+
VersionAdded: '0.48'
|
2229
2235
|
# Convert usages of `nil? || empty?` to `blank?`
|
2230
2236
|
NilOrEmpty: true
|
2231
2237
|
# Convert usages of `!present?` to `blank?`
|
@@ -2236,7 +2242,7 @@ Rails/Blank:
|
|
2236
2242
|
Rails/BulkChangeTable:
|
2237
2243
|
Description: 'Check whether alter queries are combinable.'
|
2238
2244
|
Enabled: true
|
2239
|
-
VersionAdded: 0.57
|
2245
|
+
VersionAdded: '0.57'
|
2240
2246
|
Database: null
|
2241
2247
|
SupportedDatabases:
|
2242
2248
|
- mysql
|
@@ -2249,7 +2255,7 @@ Rails/CreateTableWithTimestamps:
|
|
2249
2255
|
Checks the migration for which timestamps are not included
|
2250
2256
|
when creating a new table.
|
2251
2257
|
Enabled: true
|
2252
|
-
VersionAdded: 0.52
|
2258
|
+
VersionAdded: '0.52'
|
2253
2259
|
Include:
|
2254
2260
|
- db/migrate/*.rb
|
2255
2261
|
|
@@ -2258,8 +2264,8 @@ Rails/Date:
|
|
2258
2264
|
Checks the correct usage of date aware methods,
|
2259
2265
|
such as Date.today, Date.current etc.
|
2260
2266
|
Enabled: true
|
2261
|
-
VersionAdded: 0.30
|
2262
|
-
VersionChanged: 0.33
|
2267
|
+
VersionAdded: '0.30'
|
2268
|
+
VersionChanged: '0.33'
|
2263
2269
|
# The value `strict` disallows usage of `Date.today`, `Date.current`,
|
2264
2270
|
# `Date#to_time` etc.
|
2265
2271
|
# The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc
|
@@ -2273,8 +2279,8 @@ Rails/Date:
|
|
2273
2279
|
Rails/Delegate:
|
2274
2280
|
Description: 'Prefer delegate method for delegations.'
|
2275
2281
|
Enabled: true
|
2276
|
-
VersionAdded: 0.21
|
2277
|
-
VersionChanged: 0.50
|
2282
|
+
VersionAdded: '0.21'
|
2283
|
+
VersionChanged: '0.50'
|
2278
2284
|
# When set to true, using the target object as a prefix of the
|
2279
2285
|
# method name without using the `delegate` method will be a
|
2280
2286
|
# violation. When set to false, this case is legal.
|
@@ -2283,27 +2289,27 @@ Rails/Delegate:
|
|
2283
2289
|
Rails/DelegateAllowBlank:
|
2284
2290
|
Description: 'Do not use allow_blank as an option to delegate.'
|
2285
2291
|
Enabled: true
|
2286
|
-
VersionAdded: 0.44
|
2292
|
+
VersionAdded: '0.44'
|
2287
2293
|
|
2288
2294
|
Rails/DynamicFindBy:
|
2289
2295
|
Description: 'Use `find_by` instead of dynamic `find_by_*`.'
|
2290
2296
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find_by'
|
2291
2297
|
Enabled: true
|
2292
|
-
VersionAdded: 0.44
|
2298
|
+
VersionAdded: '0.44'
|
2293
2299
|
Whitelist:
|
2294
2300
|
- find_by_sql
|
2295
2301
|
|
2296
2302
|
Rails/EnumUniqueness:
|
2297
2303
|
Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
|
2298
2304
|
Enabled: true
|
2299
|
-
VersionAdded: 0.46
|
2305
|
+
VersionAdded: '0.46'
|
2300
2306
|
Include:
|
2301
2307
|
- app/models/**/*.rb
|
2302
2308
|
|
2303
2309
|
Rails/EnvironmentComparison:
|
2304
2310
|
Description: "Favor `Rails.env.production?` over `Rails.env == 'production'`"
|
2305
2311
|
Enabled: true
|
2306
|
-
VersionAdded: 0.52
|
2312
|
+
VersionAdded: '0.52'
|
2307
2313
|
|
2308
2314
|
Rails/Exit:
|
2309
2315
|
Description: >-
|
@@ -2311,7 +2317,7 @@ Rails/Exit:
|
|
2311
2317
|
application or library code outside of Rake files to avoid
|
2312
2318
|
exits during unit testing or running in production.
|
2313
2319
|
Enabled: true
|
2314
|
-
VersionAdded: 0.41
|
2320
|
+
VersionAdded: '0.41'
|
2315
2321
|
Include:
|
2316
2322
|
- app/**/*.rb
|
2317
2323
|
- config/**/*.rb
|
@@ -2322,8 +2328,8 @@ Rails/Exit:
|
|
2322
2328
|
Rails/FilePath:
|
2323
2329
|
Description: 'Use `Rails.root.join` for file path joining.'
|
2324
2330
|
Enabled: true
|
2325
|
-
VersionAdded: 0.47
|
2326
|
-
VersionChanged: 0.57
|
2331
|
+
VersionAdded: '0.47'
|
2332
|
+
VersionChanged: '0.57'
|
2327
2333
|
EnforcedStyle: arguments
|
2328
2334
|
SupportedStyles:
|
2329
2335
|
- slashes
|
@@ -2333,7 +2339,7 @@ Rails/FindBy:
|
|
2333
2339
|
Description: 'Prefer find_by over where.first.'
|
2334
2340
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find_by'
|
2335
2341
|
Enabled: true
|
2336
|
-
VersionAdded: 0.30
|
2342
|
+
VersionAdded: '0.30'
|
2337
2343
|
Include:
|
2338
2344
|
- app/models/**/*.rb
|
2339
2345
|
|
@@ -2341,7 +2347,7 @@ Rails/FindEach:
|
|
2341
2347
|
Description: 'Prefer all.find_each over all.find.'
|
2342
2348
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find-each'
|
2343
2349
|
Enabled: true
|
2344
|
-
VersionAdded: 0.30
|
2350
|
+
VersionAdded: '0.30'
|
2345
2351
|
Include:
|
2346
2352
|
- app/models/**/*.rb
|
2347
2353
|
|
@@ -2349,7 +2355,7 @@ Rails/HasAndBelongsToMany:
|
|
2349
2355
|
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
2350
2356
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#has-many-through'
|
2351
2357
|
Enabled: true
|
2352
|
-
VersionAdded: 0.12
|
2358
|
+
VersionAdded: '0.12'
|
2353
2359
|
Include:
|
2354
2360
|
- app/models/**/*.rb
|
2355
2361
|
|
@@ -2357,14 +2363,14 @@ Rails/HasManyOrHasOneDependent:
|
|
2357
2363
|
Description: 'Define the dependent option to the has_many and has_one associations.'
|
2358
2364
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#has_many-has_one-dependent-option'
|
2359
2365
|
Enabled: true
|
2360
|
-
VersionAdded: 0.50
|
2366
|
+
VersionAdded: '0.50'
|
2361
2367
|
Include:
|
2362
2368
|
- app/models/**/*.rb
|
2363
2369
|
|
2364
2370
|
Rails/HttpPositionalArguments:
|
2365
2371
|
Description: 'Use keyword arguments instead of positional arguments in http method calls.'
|
2366
2372
|
Enabled: true
|
2367
|
-
VersionAdded: 0.44
|
2373
|
+
VersionAdded: '0.44'
|
2368
2374
|
Include:
|
2369
2375
|
- 'spec/**/*'
|
2370
2376
|
- 'test/**/*'
|
@@ -2372,7 +2378,7 @@ Rails/HttpPositionalArguments:
|
|
2372
2378
|
Rails/HttpStatus:
|
2373
2379
|
Description: 'Enforces use of symbolic or numeric value to define HTTP status.'
|
2374
2380
|
Enabled: true
|
2375
|
-
VersionAdded: 0.54
|
2381
|
+
VersionAdded: '0.54'
|
2376
2382
|
EnforcedStyle: symbolic
|
2377
2383
|
SupportedStyles:
|
2378
2384
|
- numeric
|
@@ -2381,7 +2387,7 @@ Rails/HttpStatus:
|
|
2381
2387
|
Rails/InverseOf:
|
2382
2388
|
Description: 'Checks for associations where the inverse cannot be determined automatically.'
|
2383
2389
|
Enabled: true
|
2384
|
-
VersionAdded: 0.52
|
2390
|
+
VersionAdded: '0.52'
|
2385
2391
|
Include:
|
2386
2392
|
- app/models/**/*.rb
|
2387
2393
|
|
@@ -2389,22 +2395,22 @@ Rails/LexicallyScopedActionFilter:
|
|
2389
2395
|
Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the controller."
|
2390
2396
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#lexically-scoped-action-filter'
|
2391
2397
|
Enabled: true
|
2392
|
-
VersionAdded: 0.52
|
2398
|
+
VersionAdded: '0.52'
|
2393
2399
|
Include:
|
2394
2400
|
- app/controllers/**/*.rb
|
2395
2401
|
|
2396
2402
|
Rails/NotNullColumn:
|
2397
2403
|
Description: 'Do not add a NOT NULL column without a default value'
|
2398
2404
|
Enabled: true
|
2399
|
-
VersionAdded: 0.43
|
2405
|
+
VersionAdded: '0.43'
|
2400
2406
|
Include:
|
2401
2407
|
- db/migrate/*.rb
|
2402
2408
|
|
2403
2409
|
Rails/Output:
|
2404
2410
|
Description: 'Checks for calls to puts, print, etc.'
|
2405
2411
|
Enabled: true
|
2406
|
-
VersionAdded: 0.15
|
2407
|
-
VersionChanged: 0.19
|
2412
|
+
VersionAdded: '0.15'
|
2413
|
+
VersionChanged: '0.19'
|
2408
2414
|
Include:
|
2409
2415
|
- app/**/*.rb
|
2410
2416
|
- config/**/*.rb
|
@@ -2414,22 +2420,22 @@ Rails/Output:
|
|
2414
2420
|
Rails/OutputSafety:
|
2415
2421
|
Description: 'The use of `html_safe` or `raw` may be a security risk.'
|
2416
2422
|
Enabled: true
|
2417
|
-
VersionAdded: 0.41
|
2423
|
+
VersionAdded: '0.41'
|
2418
2424
|
|
2419
2425
|
Rails/PluralizationGrammar:
|
2420
2426
|
Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
|
2421
2427
|
Enabled: true
|
2422
|
-
VersionAdded: 0.35
|
2428
|
+
VersionAdded: '0.35'
|
2423
2429
|
|
2424
2430
|
Rails/Presence:
|
2425
2431
|
Description: 'Checks code that can be written more easily using `Object#presence` defined by Active Support.'
|
2426
2432
|
Enabled: true
|
2427
|
-
VersionAdded: 0.52
|
2433
|
+
VersionAdded: '0.52'
|
2428
2434
|
|
2429
2435
|
Rails/Present:
|
2430
2436
|
Description: 'Enforces use of `present?`.'
|
2431
2437
|
Enabled: true
|
2432
|
-
VersionAdded: 0.48
|
2438
|
+
VersionAdded: '0.48'
|
2433
2439
|
# Convert usages of `!nil? && !empty?` to `present?`
|
2434
2440
|
NotNilAndNotEmpty: true
|
2435
2441
|
# Convert usages of `!blank?` to `present?`
|
@@ -2443,34 +2449,34 @@ Rails/ReadWriteAttribute:
|
|
2443
2449
|
write_attribute(:attr, val).
|
2444
2450
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#read-attribute'
|
2445
2451
|
Enabled: true
|
2446
|
-
VersionAdded: 0.20
|
2447
|
-
VersionChanged: 0.29
|
2452
|
+
VersionAdded: '0.20'
|
2453
|
+
VersionChanged: '0.29'
|
2448
2454
|
Include:
|
2449
2455
|
- app/models/**/*.rb
|
2450
2456
|
|
2451
2457
|
Rails/RedundantReceiverInWithOptions:
|
2452
2458
|
Description: 'Checks for redundant receiver in `with_options`.'
|
2453
2459
|
Enabled: true
|
2454
|
-
VersionAdded: 0.52
|
2460
|
+
VersionAdded: '0.52'
|
2455
2461
|
|
2456
2462
|
Rails/RefuteMethods:
|
2457
2463
|
Description: 'Use `assert_not` methods instead of `refute` methods.'
|
2458
2464
|
Enabled: true
|
2459
|
-
VersionAdded: 0.56
|
2465
|
+
VersionAdded: '0.56'
|
2460
2466
|
Include:
|
2461
2467
|
- '**/test/**/*'
|
2462
2468
|
|
2463
2469
|
Rails/RelativeDateConstant:
|
2464
2470
|
Description: 'Do not assign relative date to constants.'
|
2465
2471
|
Enabled: true
|
2466
|
-
VersionAdded: 0.48
|
2467
|
-
VersionChanged: 0.59
|
2472
|
+
VersionAdded: '0.48'
|
2473
|
+
VersionChanged: '0.59'
|
2468
2474
|
AutoCorrect: false
|
2469
2475
|
|
2470
2476
|
Rails/RequestReferer:
|
2471
2477
|
Description: 'Use consistent syntax for request.referer.'
|
2472
2478
|
Enabled: true
|
2473
|
-
VersionAdded: 0.41
|
2479
|
+
VersionAdded: '0.41'
|
2474
2480
|
EnforcedStyle: referer
|
2475
2481
|
SupportedStyles:
|
2476
2482
|
- referer
|
@@ -2479,16 +2485,16 @@ Rails/RequestReferer:
|
|
2479
2485
|
Rails/ReversibleMigration:
|
2480
2486
|
Description: 'Checks whether the change method of the migration file is reversible.'
|
2481
2487
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#reversible-migration'
|
2482
|
-
Reference: '
|
2488
|
+
Reference: 'https://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
|
2483
2489
|
Enabled: true
|
2484
|
-
VersionAdded: 0.47
|
2490
|
+
VersionAdded: '0.47'
|
2485
2491
|
Include:
|
2486
2492
|
- db/migrate/*.rb
|
2487
2493
|
|
2488
2494
|
Rails/SafeNavigation:
|
2489
2495
|
Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
|
2490
2496
|
Enabled: true
|
2491
|
-
VersionAdded: 0.43
|
2497
|
+
VersionAdded: '0.43'
|
2492
2498
|
# This will convert usages of `try` to use safe navigation as well as `try!`.
|
2493
2499
|
# `try` and `try!` work slightly differently. `try!` and safe navigation will
|
2494
2500
|
# both raise a `NoMethodError` if the receiver of the method call does not
|
@@ -2499,15 +2505,15 @@ Rails/SaveBang:
|
|
2499
2505
|
Description: 'Identifies possible cases where Active Record save! or related should be used.'
|
2500
2506
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#save-bang'
|
2501
2507
|
Enabled: false
|
2502
|
-
VersionAdded: 0.42
|
2503
|
-
VersionChanged: 0.59
|
2508
|
+
VersionAdded: '0.42'
|
2509
|
+
VersionChanged: '0.59'
|
2504
2510
|
AllowImplicitReturn: true
|
2505
2511
|
AllowedReceivers: []
|
2506
2512
|
|
2507
2513
|
Rails/ScopeArgs:
|
2508
2514
|
Description: 'Checks the arguments of ActiveRecord scopes.'
|
2509
2515
|
Enabled: true
|
2510
|
-
VersionAdded: 0.19
|
2516
|
+
VersionAdded: '0.19'
|
2511
2517
|
Include:
|
2512
2518
|
- app/models/**/*.rb
|
2513
2519
|
|
@@ -2515,10 +2521,10 @@ Rails/SkipsModelValidations:
|
|
2515
2521
|
Description: >-
|
2516
2522
|
Use methods that skips model validations with caution.
|
2517
2523
|
See reference for more information.
|
2518
|
-
Reference: '
|
2524
|
+
Reference: 'https://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
|
2519
2525
|
Enabled: true
|
2520
|
-
VersionAdded: 0.47
|
2521
|
-
VersionChanged: 0.
|
2526
|
+
VersionAdded: '0.47'
|
2527
|
+
VersionChanged: '0.60'
|
2522
2528
|
Blacklist:
|
2523
2529
|
- decrement!
|
2524
2530
|
- decrement_counter
|
@@ -2538,8 +2544,8 @@ Rails/TimeZone:
|
|
2538
2544
|
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#time'
|
2539
2545
|
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
2540
2546
|
Enabled: true
|
2541
|
-
VersionAdded: 0.30
|
2542
|
-
VersionChanged: 0.33
|
2547
|
+
VersionAdded: '0.30'
|
2548
|
+
VersionChanged: '0.33'
|
2543
2549
|
# The value `strict` means that `Time` should be used with `zone`.
|
2544
2550
|
# The value `flexible` allows usage of `in_time_zone` instead of `zone`.
|
2545
2551
|
EnforcedStyle: flexible
|
@@ -2550,8 +2556,8 @@ Rails/TimeZone:
|
|
2550
2556
|
Rails/UniqBeforePluck:
|
2551
2557
|
Description: 'Prefer the use of uniq or distinct before pluck.'
|
2552
2558
|
Enabled: true
|
2553
|
-
VersionAdded: 0.40
|
2554
|
-
VersionChanged: 0.47
|
2559
|
+
VersionAdded: '0.40'
|
2560
|
+
VersionChanged: '0.47'
|
2555
2561
|
EnforcedStyle: conservative
|
2556
2562
|
SupportedStyles:
|
2557
2563
|
- conservative
|
@@ -2561,7 +2567,7 @@ Rails/UniqBeforePluck:
|
|
2561
2567
|
Rails/UnknownEnv:
|
2562
2568
|
Description: 'Use correct environment name.'
|
2563
2569
|
Enabled: true
|
2564
|
-
VersionAdded: 0.51
|
2570
|
+
VersionAdded: '0.51'
|
2565
2571
|
Environments:
|
2566
2572
|
- development
|
2567
2573
|
- test
|
@@ -2570,8 +2576,8 @@ Rails/UnknownEnv:
|
|
2570
2576
|
Rails/Validation:
|
2571
2577
|
Description: 'Use validates :attribute, hash of validations.'
|
2572
2578
|
Enabled: true
|
2573
|
-
VersionAdded: 0.9
|
2574
|
-
VersionChanged: 0.41
|
2579
|
+
VersionAdded: '0.9'
|
2580
|
+
VersionChanged: '0.41'
|
2575
2581
|
Include:
|
2576
2582
|
- app/models/**/*.rb
|
2577
2583
|
|
@@ -2580,16 +2586,16 @@ Rails/Validation:
|
|
2580
2586
|
Security/Eval:
|
2581
2587
|
Description: 'The use of eval represents a serious security risk.'
|
2582
2588
|
Enabled: true
|
2583
|
-
VersionAdded: 0.47
|
2589
|
+
VersionAdded: '0.47'
|
2584
2590
|
|
2585
2591
|
Security/JSONLoad:
|
2586
2592
|
Description: >-
|
2587
2593
|
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
2588
2594
|
security issues. See reference for more information.
|
2589
|
-
Reference: '
|
2595
|
+
Reference: 'https://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
2590
2596
|
Enabled: true
|
2591
|
-
VersionAdded: 0.43
|
2592
|
-
VersionChanged: 0.44
|
2597
|
+
VersionAdded: '0.43'
|
2598
|
+
VersionChanged: '0.44'
|
2593
2599
|
# Autocorrect here will change to a method that may cause crashes depending
|
2594
2600
|
# on the value of the argument.
|
2595
2601
|
AutoCorrect: false
|
@@ -2599,14 +2605,14 @@ Security/MarshalLoad:
|
|
2599
2605
|
Description: >-
|
2600
2606
|
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
|
2601
2607
|
security issues. See reference for more information.
|
2602
|
-
Reference: '
|
2608
|
+
Reference: 'https://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
|
2603
2609
|
Enabled: true
|
2604
|
-
VersionAdded: 0.47
|
2610
|
+
VersionAdded: '0.47'
|
2605
2611
|
|
2606
2612
|
Security/Open:
|
2607
2613
|
Description: 'The use of Kernel#open represents a serious security risk.'
|
2608
2614
|
Enabled: true
|
2609
|
-
VersionAdded: 0.53
|
2615
|
+
VersionAdded: '0.53'
|
2610
2616
|
Safe: false
|
2611
2617
|
|
2612
2618
|
Security/YAMLLoad:
|
@@ -2615,7 +2621,7 @@ Security/YAMLLoad:
|
|
2615
2621
|
security issues. See reference for more information.
|
2616
2622
|
Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
|
2617
2623
|
Enabled: true
|
2618
|
-
VersionAdded: 0.47
|
2624
|
+
VersionAdded: '0.47'
|
2619
2625
|
SafeAutoCorrect: false
|
2620
2626
|
|
2621
2627
|
#################### Style ###############################
|
@@ -2623,7 +2629,7 @@ Security/YAMLLoad:
|
|
2623
2629
|
Style/AccessModifierDeclarations:
|
2624
2630
|
Description: 'Checks style of how access modifiers are used.'
|
2625
2631
|
Enabled: true
|
2626
|
-
VersionAdded: 0.57
|
2632
|
+
VersionAdded: '0.57'
|
2627
2633
|
EnforcedStyle: group
|
2628
2634
|
SupportedStyles:
|
2629
2635
|
- inline
|
@@ -2633,8 +2639,8 @@ Style/Alias:
|
|
2633
2639
|
Description: 'Use alias instead of alias_method.'
|
2634
2640
|
StyleGuide: '#alias-method'
|
2635
2641
|
Enabled: true
|
2636
|
-
VersionAdded: 0.9
|
2637
|
-
VersionChanged: 0.36
|
2642
|
+
VersionAdded: '0.9'
|
2643
|
+
VersionChanged: '0.36'
|
2638
2644
|
EnforcedStyle: prefer_alias
|
2639
2645
|
SupportedStyles:
|
2640
2646
|
- prefer_alias
|
@@ -2644,8 +2650,8 @@ Style/AndOr:
|
|
2644
2650
|
Description: 'Use &&/|| instead of and/or.'
|
2645
2651
|
StyleGuide: '#no-and-or-or'
|
2646
2652
|
Enabled: true
|
2647
|
-
VersionAdded: 0.9
|
2648
|
-
VersionChanged: 0.25
|
2653
|
+
VersionAdded: '0.9'
|
2654
|
+
VersionChanged: '0.25'
|
2649
2655
|
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
2650
2656
|
# or completely (always).
|
2651
2657
|
EnforcedStyle: always
|
@@ -2657,34 +2663,34 @@ Style/ArrayJoin:
|
|
2657
2663
|
Description: 'Use Array#join instead of Array#*.'
|
2658
2664
|
StyleGuide: '#array-join'
|
2659
2665
|
Enabled: true
|
2660
|
-
VersionAdded: 0.20
|
2661
|
-
VersionChanged: 0.31
|
2666
|
+
VersionAdded: '0.20'
|
2667
|
+
VersionChanged: '0.31'
|
2662
2668
|
|
2663
2669
|
Style/AsciiComments:
|
2664
2670
|
Description: 'Use only ascii symbols in comments.'
|
2665
2671
|
StyleGuide: '#english-comments'
|
2666
2672
|
Enabled: true
|
2667
|
-
VersionAdded: 0.9
|
2668
|
-
VersionChanged: 0.52
|
2673
|
+
VersionAdded: '0.9'
|
2674
|
+
VersionChanged: '0.52'
|
2669
2675
|
AllowedChars: []
|
2670
2676
|
|
2671
2677
|
Style/Attr:
|
2672
2678
|
Description: 'Checks for uses of Module#attr.'
|
2673
2679
|
StyleGuide: '#attr'
|
2674
2680
|
Enabled: true
|
2675
|
-
VersionAdded: 0.9
|
2676
|
-
VersionChanged: 0.12
|
2681
|
+
VersionAdded: '0.9'
|
2682
|
+
VersionChanged: '0.12'
|
2677
2683
|
|
2678
2684
|
Style/AutoResourceCleanup:
|
2679
2685
|
Description: 'Suggests the usage of an auto resource cleanup version of a method (if available).'
|
2680
2686
|
Enabled: false
|
2681
|
-
VersionAdded: 0.30
|
2687
|
+
VersionAdded: '0.30'
|
2682
2688
|
|
2683
2689
|
Style/BarePercentLiterals:
|
2684
2690
|
Description: 'Checks if usage of %() or %Q() matches configuration.'
|
2685
2691
|
StyleGuide: '#percent-q-shorthand'
|
2686
2692
|
Enabled: true
|
2687
|
-
VersionAdded: 0.25
|
2693
|
+
VersionAdded: '0.25'
|
2688
2694
|
EnforcedStyle: bare_percent
|
2689
2695
|
SupportedStyles:
|
2690
2696
|
- percent_q
|
@@ -2694,14 +2700,14 @@ Style/BeginBlock:
|
|
2694
2700
|
Description: 'Avoid the use of BEGIN blocks.'
|
2695
2701
|
StyleGuide: '#no-BEGIN-blocks'
|
2696
2702
|
Enabled: true
|
2697
|
-
VersionAdded: 0.9
|
2703
|
+
VersionAdded: '0.9'
|
2698
2704
|
|
2699
2705
|
Style/BlockComments:
|
2700
2706
|
Description: 'Do not use block comments.'
|
2701
2707
|
StyleGuide: '#no-block-comments'
|
2702
2708
|
Enabled: true
|
2703
|
-
VersionAdded: 0.9
|
2704
|
-
VersionChanged: 0.23
|
2709
|
+
VersionAdded: '0.9'
|
2710
|
+
VersionChanged: '0.23'
|
2705
2711
|
|
2706
2712
|
Style/BlockDelimiters:
|
2707
2713
|
Description: >-
|
@@ -2710,8 +2716,8 @@ Style/BlockDelimiters:
|
|
2710
2716
|
Prefer {...} over do...end for single-line blocks.
|
2711
2717
|
StyleGuide: '#single-line-blocks'
|
2712
2718
|
Enabled: true
|
2713
|
-
VersionAdded: 0.30
|
2714
|
-
VersionChanged: 0.35
|
2719
|
+
VersionAdded: '0.30'
|
2720
|
+
VersionChanged: '0.35'
|
2715
2721
|
EnforcedStyle: line_count_based
|
2716
2722
|
SupportedStyles:
|
2717
2723
|
# The `line_count_based` style enforces braces around single line blocks and
|
@@ -2785,8 +2791,8 @@ Style/BlockDelimiters:
|
|
2785
2791
|
Style/BracesAroundHashParameters:
|
2786
2792
|
Description: 'Enforce braces style around hash parameters.'
|
2787
2793
|
Enabled: true
|
2788
|
-
VersionAdded: 0.14.1
|
2789
|
-
VersionChanged: 0.28
|
2794
|
+
VersionAdded: '0.14.1'
|
2795
|
+
VersionChanged: '0.28'
|
2790
2796
|
EnforcedStyle: no_braces
|
2791
2797
|
SupportedStyles:
|
2792
2798
|
# The `braces` style enforces braces around all method parameters that are
|
@@ -2804,13 +2810,13 @@ Style/CaseEquality:
|
|
2804
2810
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
2805
2811
|
StyleGuide: '#no-case-equality'
|
2806
2812
|
Enabled: true
|
2807
|
-
VersionAdded: 0.9
|
2813
|
+
VersionAdded: '0.9'
|
2808
2814
|
|
2809
2815
|
Style/CharacterLiteral:
|
2810
2816
|
Description: 'Checks for uses of character literals.'
|
2811
2817
|
StyleGuide: '#no-character-literals'
|
2812
2818
|
Enabled: true
|
2813
|
-
VersionAdded: 0.9
|
2819
|
+
VersionAdded: '0.9'
|
2814
2820
|
|
2815
2821
|
Style/ClassAndModuleChildren:
|
2816
2822
|
Description: 'Checks style of children classes and modules.'
|
@@ -2823,7 +2829,7 @@ Style/ClassAndModuleChildren:
|
|
2823
2829
|
SafeAutoCorrect: false
|
2824
2830
|
AutoCorrect: false
|
2825
2831
|
Enabled: true
|
2826
|
-
VersionAdded: 0.19
|
2832
|
+
VersionAdded: '0.19'
|
2827
2833
|
#
|
2828
2834
|
# Basically there are two different styles:
|
2829
2835
|
#
|
@@ -2846,7 +2852,7 @@ Style/ClassAndModuleChildren:
|
|
2846
2852
|
Style/ClassCheck:
|
2847
2853
|
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
2848
2854
|
Enabled: true
|
2849
|
-
VersionAdded: 0.24
|
2855
|
+
VersionAdded: '0.24'
|
2850
2856
|
EnforcedStyle: is_a?
|
2851
2857
|
SupportedStyles:
|
2852
2858
|
- is_a?
|
@@ -2856,22 +2862,22 @@ Style/ClassMethods:
|
|
2856
2862
|
Description: 'Use self when defining module/class methods.'
|
2857
2863
|
StyleGuide: '#def-self-class-methods'
|
2858
2864
|
Enabled: true
|
2859
|
-
VersionAdded: 0.9
|
2860
|
-
VersionChanged: 0.20
|
2865
|
+
VersionAdded: '0.9'
|
2866
|
+
VersionChanged: '0.20'
|
2861
2867
|
|
2862
2868
|
Style/ClassVars:
|
2863
2869
|
Description: 'Avoid the use of class variables.'
|
2864
2870
|
StyleGuide: '#no-class-vars'
|
2865
2871
|
Enabled: true
|
2866
|
-
VersionAdded: 0.13
|
2872
|
+
VersionAdded: '0.13'
|
2867
2873
|
|
2868
2874
|
# Align with the style guide.
|
2869
2875
|
Style/CollectionMethods:
|
2870
2876
|
Description: 'Preferred collection methods.'
|
2871
2877
|
StyleGuide: '#map-find-select-reduce-size'
|
2872
2878
|
Enabled: false
|
2873
|
-
VersionAdded: 0.9
|
2874
|
-
VersionChanged: 0.27
|
2879
|
+
VersionAdded: '0.9'
|
2880
|
+
VersionChanged: '0.27'
|
2875
2881
|
Safe: false
|
2876
2882
|
# Mapping from undesired method to desired method
|
2877
2883
|
# e.g. to use `detect` over `find`:
|
@@ -2890,19 +2896,19 @@ Style/ColonMethodCall:
|
|
2890
2896
|
Description: 'Do not use :: for method call.'
|
2891
2897
|
StyleGuide: '#double-colons'
|
2892
2898
|
Enabled: true
|
2893
|
-
VersionAdded: 0.9
|
2899
|
+
VersionAdded: '0.9'
|
2894
2900
|
|
2895
2901
|
Style/ColonMethodDefinition:
|
2896
2902
|
Description: 'Do not use :: for defining class methods.'
|
2897
2903
|
StyleGuide: '#colon-method-definition'
|
2898
2904
|
Enabled: true
|
2899
|
-
VersionAdded: 0.52
|
2905
|
+
VersionAdded: '0.52'
|
2900
2906
|
|
2901
2907
|
Style/CommandLiteral:
|
2902
2908
|
Description: 'Use `` or %x around command literals.'
|
2903
2909
|
StyleGuide: '#percent-x'
|
2904
2910
|
Enabled: true
|
2905
|
-
VersionAdded: 0.30
|
2911
|
+
VersionAdded: '0.30'
|
2906
2912
|
EnforcedStyle: backticks
|
2907
2913
|
# backticks: Always use backticks.
|
2908
2914
|
# percent_x: Always use `%x`.
|
@@ -2922,8 +2928,8 @@ Style/CommentAnnotation:
|
|
2922
2928
|
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
2923
2929
|
StyleGuide: '#annotate-keywords'
|
2924
2930
|
Enabled: true
|
2925
|
-
VersionAdded: 0.10
|
2926
|
-
VersionChanged: 0.31
|
2931
|
+
VersionAdded: '0.10'
|
2932
|
+
VersionChanged: '0.31'
|
2927
2933
|
Keywords:
|
2928
2934
|
- TODO
|
2929
2935
|
- FIXME
|
@@ -2934,7 +2940,7 @@ Style/CommentAnnotation:
|
|
2934
2940
|
Style/CommentedKeyword:
|
2935
2941
|
Description: 'Do not place comments on the same line as certain keywords.'
|
2936
2942
|
Enabled: true
|
2937
|
-
VersionAdded: 0.51
|
2943
|
+
VersionAdded: '0.51'
|
2938
2944
|
|
2939
2945
|
Style/ConditionalAssignment:
|
2940
2946
|
Description: >-
|
@@ -2942,8 +2948,8 @@ Style/ConditionalAssignment:
|
|
2942
2948
|
assignment to a variable and variable comparison instead
|
2943
2949
|
of assigning that variable inside of each branch.
|
2944
2950
|
Enabled: true
|
2945
|
-
VersionAdded: 0.36
|
2946
|
-
VersionChanged: 0.47
|
2951
|
+
VersionAdded: '0.36'
|
2952
|
+
VersionChanged: '0.47'
|
2947
2953
|
EnforcedStyle: assign_to_condition
|
2948
2954
|
SupportedStyles:
|
2949
2955
|
- assign_to_condition
|
@@ -2978,36 +2984,36 @@ Style/ConditionalAssignment:
|
|
2978
2984
|
Style/Copyright:
|
2979
2985
|
Description: 'Include a copyright notice in each file before any code.'
|
2980
2986
|
Enabled: false
|
2981
|
-
VersionAdded: 0.30
|
2987
|
+
VersionAdded: '0.30'
|
2982
2988
|
Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
|
2983
2989
|
AutocorrectNotice: ''
|
2984
2990
|
|
2985
2991
|
Style/DateTime:
|
2986
|
-
Description: 'Use
|
2992
|
+
Description: 'Use Time over DateTime.'
|
2987
2993
|
StyleGuide: '#date--time'
|
2988
|
-
Enabled:
|
2989
|
-
VersionAdded: 0.51
|
2990
|
-
VersionChanged: 0.59
|
2994
|
+
Enabled: false
|
2995
|
+
VersionAdded: '0.51'
|
2996
|
+
VersionChanged: '0.59'
|
2991
2997
|
AllowCoercion: false
|
2992
2998
|
|
2993
2999
|
Style/DefWithParentheses:
|
2994
3000
|
Description: 'Use def with parentheses when there are arguments.'
|
2995
3001
|
StyleGuide: '#method-parens'
|
2996
3002
|
Enabled: true
|
2997
|
-
VersionAdded: 0.9
|
2998
|
-
VersionChanged: 0.12
|
3003
|
+
VersionAdded: '0.9'
|
3004
|
+
VersionChanged: '0.12'
|
2999
3005
|
|
3000
3006
|
Style/Dir:
|
3001
3007
|
Description: >-
|
3002
3008
|
Use the `__dir__` method to retrieve the canonicalized
|
3003
3009
|
absolute path to the current file.
|
3004
3010
|
Enabled: true
|
3005
|
-
VersionAdded: 0.50
|
3011
|
+
VersionAdded: '0.50'
|
3006
3012
|
|
3007
3013
|
Style/Documentation:
|
3008
3014
|
Description: 'Document classes and non-namespace modules.'
|
3009
3015
|
Enabled: true
|
3010
|
-
VersionAdded: 0.9
|
3016
|
+
VersionAdded: '0.9'
|
3011
3017
|
Exclude:
|
3012
3018
|
- 'spec/**/*'
|
3013
3019
|
- 'test/**/*'
|
@@ -3015,7 +3021,7 @@ Style/Documentation:
|
|
3015
3021
|
Style/DocumentationMethod:
|
3016
3022
|
Description: 'Checks for missing documentation comment for public methods.'
|
3017
3023
|
Enabled: false
|
3018
|
-
VersionAdded: 0.43
|
3024
|
+
VersionAdded: '0.43'
|
3019
3025
|
Exclude:
|
3020
3026
|
- 'spec/**/*'
|
3021
3027
|
- 'test/**/*'
|
@@ -3025,36 +3031,36 @@ Style/DoubleNegation:
|
|
3025
3031
|
Description: 'Checks for uses of double negation (!!).'
|
3026
3032
|
StyleGuide: '#no-bang-bang'
|
3027
3033
|
Enabled: true
|
3028
|
-
VersionAdded: 0.19
|
3034
|
+
VersionAdded: '0.19'
|
3029
3035
|
|
3030
3036
|
Style/EachForSimpleLoop:
|
3031
3037
|
Description: >-
|
3032
3038
|
Use `Integer#times` for a simple loop which iterates a fixed
|
3033
3039
|
number of times.
|
3034
3040
|
Enabled: true
|
3035
|
-
VersionAdded: 0.41
|
3041
|
+
VersionAdded: '0.41'
|
3036
3042
|
|
3037
3043
|
Style/EachWithObject:
|
3038
3044
|
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
3039
3045
|
Enabled: true
|
3040
|
-
VersionAdded: 0.22
|
3041
|
-
VersionChanged: 0.42
|
3046
|
+
VersionAdded: '0.22'
|
3047
|
+
VersionChanged: '0.42'
|
3042
3048
|
|
3043
3049
|
Style/EmptyBlockParameter:
|
3044
3050
|
Description: 'Omit pipes for empty block parameters.'
|
3045
3051
|
Enabled: true
|
3046
|
-
VersionAdded: 0.52
|
3052
|
+
VersionAdded: '0.52'
|
3047
3053
|
|
3048
3054
|
Style/EmptyCaseCondition:
|
3049
3055
|
Description: 'Avoid empty condition in case statements.'
|
3050
3056
|
Enabled: true
|
3051
|
-
VersionAdded: 0.40
|
3057
|
+
VersionAdded: '0.40'
|
3052
3058
|
|
3053
3059
|
Style/EmptyElse:
|
3054
3060
|
Description: 'Avoid empty else-clauses.'
|
3055
3061
|
Enabled: true
|
3056
|
-
VersionAdded: 0.28
|
3057
|
-
VersionChanged: 0.32
|
3062
|
+
VersionAdded: '0.28'
|
3063
|
+
VersionChanged: '0.32'
|
3058
3064
|
EnforcedStyle: both
|
3059
3065
|
# empty - warn only on empty `else`
|
3060
3066
|
# nil - warn on `else` with nil in it
|
@@ -3067,20 +3073,20 @@ Style/EmptyElse:
|
|
3067
3073
|
Style/EmptyLambdaParameter:
|
3068
3074
|
Description: 'Omit parens for empty lambda parameters.'
|
3069
3075
|
Enabled: true
|
3070
|
-
VersionAdded: 0.52
|
3076
|
+
VersionAdded: '0.52'
|
3071
3077
|
|
3072
3078
|
Style/EmptyLiteral:
|
3073
3079
|
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
3074
3080
|
StyleGuide: '#literal-array-hash'
|
3075
3081
|
Enabled: true
|
3076
|
-
VersionAdded: 0.9
|
3077
|
-
VersionChanged: 0.12
|
3082
|
+
VersionAdded: '0.9'
|
3083
|
+
VersionChanged: '0.12'
|
3078
3084
|
|
3079
3085
|
Style/EmptyMethod:
|
3080
3086
|
Description: 'Checks the formatting of empty method definitions.'
|
3081
3087
|
StyleGuide: '#no-single-line-methods'
|
3082
3088
|
Enabled: true
|
3083
|
-
VersionAdded: 0.46
|
3089
|
+
VersionAdded: '0.46'
|
3084
3090
|
EnforcedStyle: compact
|
3085
3091
|
SupportedStyles:
|
3086
3092
|
- compact
|
@@ -3090,44 +3096,44 @@ Style/Encoding:
|
|
3090
3096
|
Description: 'Use UTF-8 as the source file encoding.'
|
3091
3097
|
StyleGuide: '#utf-8'
|
3092
3098
|
Enabled: true
|
3093
|
-
VersionAdded: 0.9
|
3094
|
-
VersionChanged: 0.50
|
3099
|
+
VersionAdded: '0.9'
|
3100
|
+
VersionChanged: '0.50'
|
3095
3101
|
|
3096
3102
|
Style/EndBlock:
|
3097
3103
|
Description: 'Avoid the use of END blocks.'
|
3098
3104
|
StyleGuide: '#no-END-blocks'
|
3099
3105
|
Enabled: true
|
3100
|
-
VersionAdded: 0.9
|
3106
|
+
VersionAdded: '0.9'
|
3101
3107
|
|
3102
3108
|
Style/EvalWithLocation:
|
3103
3109
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
3104
3110
|
Enabled: true
|
3105
|
-
VersionAdded: 0.52
|
3111
|
+
VersionAdded: '0.52'
|
3106
3112
|
|
3107
3113
|
Style/EvenOdd:
|
3108
3114
|
Description: 'Favor the use of Integer#even? && Integer#odd?'
|
3109
3115
|
StyleGuide: '#predicate-methods'
|
3110
3116
|
Enabled: true
|
3111
|
-
VersionAdded: 0.12
|
3112
|
-
VersionChanged: 0.29
|
3117
|
+
VersionAdded: '0.12'
|
3118
|
+
VersionChanged: '0.29'
|
3113
3119
|
|
3114
3120
|
Style/ExpandPathArguments:
|
3115
3121
|
Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`."
|
3116
3122
|
Enabled: true
|
3117
|
-
VersionAdded: 0.53
|
3123
|
+
VersionAdded: '0.53'
|
3118
3124
|
|
3119
3125
|
Style/FlipFlop:
|
3120
3126
|
Description: 'Checks for flip flops'
|
3121
3127
|
StyleGuide: '#no-flip-flops'
|
3122
3128
|
Enabled: true
|
3123
|
-
VersionAdded: 0.16
|
3129
|
+
VersionAdded: '0.16'
|
3124
3130
|
|
3125
3131
|
Style/For:
|
3126
3132
|
Description: 'Checks use of for or each in multiline loops.'
|
3127
3133
|
StyleGuide: '#no-for-loops'
|
3128
3134
|
Enabled: true
|
3129
|
-
VersionAdded: 0.13
|
3130
|
-
VersionChanged: 0.59
|
3135
|
+
VersionAdded: '0.13'
|
3136
|
+
VersionChanged: '0.59'
|
3131
3137
|
EnforcedStyle: each
|
3132
3138
|
SupportedStyles:
|
3133
3139
|
- each
|
@@ -3137,8 +3143,8 @@ Style/FormatString:
|
|
3137
3143
|
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
3138
3144
|
StyleGuide: '#sprintf'
|
3139
3145
|
Enabled: true
|
3140
|
-
VersionAdded: 0.19
|
3141
|
-
VersionChanged: 0.49
|
3146
|
+
VersionAdded: '0.19'
|
3147
|
+
VersionChanged: '0.49'
|
3142
3148
|
EnforcedStyle: format
|
3143
3149
|
SupportedStyles:
|
3144
3150
|
- format
|
@@ -3156,16 +3162,16 @@ Style/FormatStringToken:
|
|
3156
3162
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
3157
3163
|
- template
|
3158
3164
|
- unannotated
|
3159
|
-
VersionAdded: 0.49
|
3160
|
-
VersionChanged: 0.52
|
3165
|
+
VersionAdded: '0.49'
|
3166
|
+
VersionChanged: '0.52'
|
3161
3167
|
|
3162
3168
|
Style/FrozenStringLiteralComment:
|
3163
3169
|
Description: >-
|
3164
3170
|
Add the frozen_string_literal comment to the top of files
|
3165
3171
|
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
3166
3172
|
Enabled: true
|
3167
|
-
VersionAdded: 0.36
|
3168
|
-
VersionChanged: 0.47
|
3173
|
+
VersionAdded: '0.36'
|
3174
|
+
VersionChanged: '0.47'
|
3169
3175
|
EnforcedStyle: when_needed
|
3170
3176
|
SupportedStyles:
|
3171
3177
|
# `when_needed` will add the frozen string literal comment to files
|
@@ -3183,9 +3189,9 @@ Style/FrozenStringLiteralComment:
|
|
3183
3189
|
Style/GlobalVars:
|
3184
3190
|
Description: 'Do not introduce global variables.'
|
3185
3191
|
StyleGuide: '#instance-vars'
|
3186
|
-
Reference: '
|
3192
|
+
Reference: 'https://www.zenspider.com/ruby/quickref.html'
|
3187
3193
|
Enabled: true
|
3188
|
-
VersionAdded: 0.13
|
3194
|
+
VersionAdded: '0.13'
|
3189
3195
|
# Built-in global variables are allowed by default.
|
3190
3196
|
AllowedVariables: []
|
3191
3197
|
|
@@ -3193,8 +3199,8 @@ Style/GuardClause:
|
|
3193
3199
|
Description: 'Check for conditionals that can be replaced with guard clauses'
|
3194
3200
|
StyleGuide: '#no-nested-conditionals'
|
3195
3201
|
Enabled: true
|
3196
|
-
VersionAdded: 0.20
|
3197
|
-
VersionChanged: 0.22
|
3202
|
+
VersionAdded: '0.20'
|
3203
|
+
VersionChanged: '0.22'
|
3198
3204
|
# `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
|
3199
3205
|
# needs to have to trigger this cop
|
3200
3206
|
MinBodyLength: 1
|
@@ -3205,8 +3211,8 @@ Style/HashSyntax:
|
|
3205
3211
|
{ :a => 1, :b => 2 }.
|
3206
3212
|
StyleGuide: '#hash-literals'
|
3207
3213
|
Enabled: true
|
3208
|
-
VersionAdded: 0.9
|
3209
|
-
VersionChanged: 0.43
|
3214
|
+
VersionAdded: '0.9'
|
3215
|
+
VersionChanged: '0.43'
|
3210
3216
|
EnforcedStyle: ruby19
|
3211
3217
|
SupportedStyles:
|
3212
3218
|
# checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
|
@@ -3228,12 +3234,12 @@ Style/IdenticalConditionalBranches:
|
|
3228
3234
|
line at the end of each branch, which can validly be moved
|
3229
3235
|
out of the conditional.
|
3230
3236
|
Enabled: true
|
3231
|
-
VersionAdded: 0.36
|
3237
|
+
VersionAdded: '0.36'
|
3232
3238
|
|
3233
3239
|
Style/IfInsideElse:
|
3234
3240
|
Description: 'Finds if nodes inside else, which can be converted to elsif.'
|
3235
3241
|
Enabled: true
|
3236
|
-
VersionAdded: 0.36
|
3242
|
+
VersionAdded: '0.36'
|
3237
3243
|
|
3238
3244
|
Style/IfUnlessModifier:
|
3239
3245
|
Description: >-
|
@@ -3241,39 +3247,40 @@ Style/IfUnlessModifier:
|
|
3241
3247
|
single-line body.
|
3242
3248
|
StyleGuide: '#if-as-a-modifier'
|
3243
3249
|
Enabled: true
|
3244
|
-
VersionAdded: 0.9
|
3245
|
-
VersionChanged: 0.30
|
3250
|
+
VersionAdded: '0.9'
|
3251
|
+
VersionChanged: '0.30'
|
3246
3252
|
|
3247
3253
|
Style/IfUnlessModifierOfIfUnless:
|
3248
3254
|
Description: >-
|
3249
3255
|
Avoid modifier if/unless usage on conditionals.
|
3250
3256
|
Enabled: true
|
3251
|
-
VersionAdded: 0.39
|
3257
|
+
VersionAdded: '0.39'
|
3252
3258
|
|
3253
3259
|
Style/IfWithSemicolon:
|
3254
3260
|
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
3255
3261
|
StyleGuide: '#no-semicolon-ifs'
|
3256
3262
|
Enabled: true
|
3257
|
-
VersionAdded: 0.9
|
3263
|
+
VersionAdded: '0.9'
|
3258
3264
|
|
3259
3265
|
Style/ImplicitRuntimeError:
|
3260
3266
|
Description: >-
|
3261
3267
|
Use `raise` or `fail` with an explicit exception class and
|
3262
3268
|
message, rather than just a message.
|
3263
3269
|
Enabled: false
|
3264
|
-
VersionAdded: 0.41
|
3270
|
+
VersionAdded: '0.41'
|
3265
3271
|
|
3266
3272
|
Style/InfiniteLoop:
|
3267
3273
|
Description: 'Use Kernel#loop for infinite loops.'
|
3268
3274
|
StyleGuide: '#infinite-loop'
|
3269
3275
|
Enabled: true
|
3270
|
-
VersionAdded: 0.26
|
3271
|
-
|
3276
|
+
VersionAdded: '0.26'
|
3277
|
+
VersionChanged: '0.61'
|
3278
|
+
SafeAutoCorrect: true
|
3272
3279
|
|
3273
3280
|
Style/InlineComment:
|
3274
3281
|
Description: 'Avoid trailing inline comments.'
|
3275
3282
|
Enabled: false
|
3276
|
-
VersionAdded: 0.23
|
3283
|
+
VersionAdded: '0.23'
|
3277
3284
|
|
3278
3285
|
Style/InverseMethods:
|
3279
3286
|
Description: >-
|
@@ -3281,7 +3288,7 @@ Style/InverseMethods:
|
|
3281
3288
|
if an inverse method is defined.
|
3282
3289
|
Enabled: true
|
3283
3290
|
Safe: false
|
3284
|
-
VersionAdded: 0.48
|
3291
|
+
VersionAdded: '0.48'
|
3285
3292
|
# `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
|
3286
3293
|
# The relationship of inverse methods only needs to be defined in one direction.
|
3287
3294
|
# Keys and values both need to be defined as symbols.
|
@@ -3305,7 +3312,7 @@ Style/InverseMethods:
|
|
3305
3312
|
Style/IpAddresses:
|
3306
3313
|
Description: "Don't include literal IP addresses in code."
|
3307
3314
|
Enabled: false
|
3308
|
-
VersionAdded: 0.58
|
3315
|
+
VersionAdded: '0.58'
|
3309
3316
|
# Allow strings to be whitelisted
|
3310
3317
|
Whitelist:
|
3311
3318
|
- "::"
|
@@ -3315,8 +3322,8 @@ Style/Lambda:
|
|
3315
3322
|
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
3316
3323
|
StyleGuide: '#lambda-multi-line'
|
3317
3324
|
Enabled: true
|
3318
|
-
VersionAdded: 0.9
|
3319
|
-
VersionChanged: 0.40
|
3325
|
+
VersionAdded: '0.9'
|
3326
|
+
VersionChanged: '0.40'
|
3320
3327
|
EnforcedStyle: line_count_dependent
|
3321
3328
|
SupportedStyles:
|
3322
3329
|
- line_count_dependent
|
@@ -3327,8 +3334,8 @@ Style/LambdaCall:
|
|
3327
3334
|
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
3328
3335
|
StyleGuide: '#proc-call'
|
3329
3336
|
Enabled: true
|
3330
|
-
VersionAdded: 0.13.1
|
3331
|
-
VersionChanged: 0.14
|
3337
|
+
VersionAdded: '0.13.1'
|
3338
|
+
VersionChanged: '0.14'
|
3332
3339
|
EnforcedStyle: call
|
3333
3340
|
SupportedStyles:
|
3334
3341
|
- call
|
@@ -3339,30 +3346,36 @@ Style/LineEndConcatenation:
|
|
3339
3346
|
Use \ instead of + or << to concatenate two string literals at
|
3340
3347
|
line end.
|
3341
3348
|
Enabled: true
|
3342
|
-
VersionAdded: 0.18
|
3349
|
+
VersionAdded: '0.18'
|
3343
3350
|
|
3344
3351
|
Style/MethodCallWithArgsParentheses:
|
3345
3352
|
Description: 'Use parentheses for method calls with arguments.'
|
3346
3353
|
StyleGuide: '#method-invocation-parens'
|
3347
3354
|
Enabled: false
|
3348
|
-
VersionAdded: 0.47
|
3349
|
-
VersionChanged: 0.
|
3355
|
+
VersionAdded: '0.47'
|
3356
|
+
VersionChanged: '0.61'
|
3350
3357
|
IgnoreMacros: true
|
3351
3358
|
IgnoredMethods: []
|
3359
|
+
AllowParenthesesInMultilineCall: false
|
3360
|
+
AllowParenthesesInChaining: false
|
3361
|
+
EnforcedStyle: require_parentheses
|
3362
|
+
SupportedStyles:
|
3363
|
+
- require_parentheses
|
3364
|
+
- omit_parentheses
|
3352
3365
|
|
3353
3366
|
Style/MethodCallWithoutArgsParentheses:
|
3354
3367
|
Description: 'Do not use parentheses for method calls with no arguments.'
|
3355
3368
|
StyleGuide: '#method-invocation-parens'
|
3356
3369
|
Enabled: true
|
3357
3370
|
IgnoredMethods: []
|
3358
|
-
VersionAdded: 0.47
|
3359
|
-
VersionChanged: 0.55
|
3371
|
+
VersionAdded: '0.47'
|
3372
|
+
VersionChanged: '0.55'
|
3360
3373
|
|
3361
3374
|
Style/MethodCalledOnDoEndBlock:
|
3362
3375
|
Description: 'Avoid chaining a method call on a do...end block.'
|
3363
3376
|
StyleGuide: '#single-line-blocks'
|
3364
3377
|
Enabled: false
|
3365
|
-
VersionAdded: 0.14
|
3378
|
+
VersionAdded: '0.14'
|
3366
3379
|
|
3367
3380
|
Style/MethodDefParentheses:
|
3368
3381
|
Description: >-
|
@@ -3370,8 +3383,8 @@ Style/MethodDefParentheses:
|
|
3370
3383
|
parentheses.
|
3371
3384
|
StyleGuide: '#method-parens'
|
3372
3385
|
Enabled: true
|
3373
|
-
VersionAdded: 0.16
|
3374
|
-
VersionChanged: 0.35
|
3386
|
+
VersionAdded: '0.16'
|
3387
|
+
VersionChanged: '0.35'
|
3375
3388
|
EnforcedStyle: require_parentheses
|
3376
3389
|
SupportedStyles:
|
3377
3390
|
- require_parentheses
|
@@ -3382,14 +3395,14 @@ Style/MethodMissingSuper:
|
|
3382
3395
|
Description: Checks for `method_missing` to call `super`.
|
3383
3396
|
StyleGuide: '#no-method-missing'
|
3384
3397
|
Enabled: true
|
3385
|
-
VersionAdded: 0.56
|
3398
|
+
VersionAdded: '0.56'
|
3386
3399
|
|
3387
3400
|
Style/MinMax:
|
3388
3401
|
Description: >-
|
3389
3402
|
Use `Enumerable#minmax` instead of `Enumerable#min`
|
3390
3403
|
and `Enumerable#max` in conjunction.'
|
3391
3404
|
Enabled: true
|
3392
|
-
VersionAdded: 0.50
|
3405
|
+
VersionAdded: '0.50'
|
3393
3406
|
|
3394
3407
|
Style/MissingElse:
|
3395
3408
|
Description: >-
|
@@ -3399,8 +3412,8 @@ Style/MissingElse:
|
|
3399
3412
|
This will conflict with Style/EmptyElse if
|
3400
3413
|
Style/EmptyElse is configured to style "both"
|
3401
3414
|
Enabled: false
|
3402
|
-
VersionAdded: 0.30
|
3403
|
-
VersionChanged: 0.38
|
3415
|
+
VersionAdded: '0.30'
|
3416
|
+
VersionChanged: '0.38'
|
3404
3417
|
EnforcedStyle: both
|
3405
3418
|
SupportedStyles:
|
3406
3419
|
# if - warn when an if expression is missing an else branch
|
@@ -3416,14 +3429,14 @@ Style/MissingRespondToMissing:
|
|
3416
3429
|
without implementing `respond_to_missing`.
|
3417
3430
|
StyleGuide: '#no-method-missing'
|
3418
3431
|
Enabled: true
|
3419
|
-
VersionAdded: 0.56
|
3432
|
+
VersionAdded: '0.56'
|
3420
3433
|
|
3421
3434
|
Style/MixinGrouping:
|
3422
3435
|
Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
|
3423
3436
|
StyleGuide: '#mixin-grouping'
|
3424
3437
|
Enabled: true
|
3425
|
-
VersionAdded: 0.48
|
3426
|
-
VersionChanged: 0.49
|
3438
|
+
VersionAdded: '0.48'
|
3439
|
+
VersionChanged: '0.49'
|
3427
3440
|
EnforcedStyle: separated
|
3428
3441
|
SupportedStyles:
|
3429
3442
|
# separated: each mixed in module goes in a separate statement.
|
@@ -3434,14 +3447,14 @@ Style/MixinGrouping:
|
|
3434
3447
|
Style/MixinUsage:
|
3435
3448
|
Description: 'Checks that `include`, `extend` and `prepend` exists at the top level.'
|
3436
3449
|
Enabled: true
|
3437
|
-
VersionAdded: 0.51
|
3450
|
+
VersionAdded: '0.51'
|
3438
3451
|
|
3439
3452
|
Style/ModuleFunction:
|
3440
3453
|
Description: 'Checks for usage of `extend self` in modules.'
|
3441
3454
|
StyleGuide: '#module-function'
|
3442
3455
|
Enabled: true
|
3443
|
-
VersionAdded: 0.11
|
3444
|
-
VersionChanged: 0.53
|
3456
|
+
VersionAdded: '0.11'
|
3457
|
+
VersionChanged: '0.53'
|
3445
3458
|
EnforcedStyle: module_function
|
3446
3459
|
SupportedStyles:
|
3447
3460
|
- module_function
|
@@ -3451,26 +3464,26 @@ Style/MultilineBlockChain:
|
|
3451
3464
|
Description: 'Avoid multi-line chains of blocks.'
|
3452
3465
|
StyleGuide: '#single-line-blocks'
|
3453
3466
|
Enabled: true
|
3454
|
-
VersionAdded: 0.13
|
3467
|
+
VersionAdded: '0.13'
|
3455
3468
|
|
3456
3469
|
Style/MultilineIfModifier:
|
3457
3470
|
Description: 'Only use if/unless modifiers on single line statements.'
|
3458
3471
|
StyleGuide: '#no-multiline-if-modifiers'
|
3459
3472
|
Enabled: true
|
3460
|
-
VersionAdded: 0.45
|
3473
|
+
VersionAdded: '0.45'
|
3461
3474
|
|
3462
3475
|
Style/MultilineIfThen:
|
3463
3476
|
Description: 'Do not use then for multi-line if/unless.'
|
3464
3477
|
StyleGuide: '#no-then'
|
3465
3478
|
Enabled: true
|
3466
|
-
VersionAdded: 0.9
|
3467
|
-
VersionChanged: 0.26
|
3479
|
+
VersionAdded: '0.9'
|
3480
|
+
VersionChanged: '0.26'
|
3468
3481
|
|
3469
3482
|
Style/MultilineMemoization:
|
3470
3483
|
Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
|
3471
3484
|
Enabled: true
|
3472
|
-
VersionAdded: 0.44
|
3473
|
-
VersionChanged: 0.48
|
3485
|
+
VersionAdded: '0.44'
|
3486
|
+
VersionChanged: '0.48'
|
3474
3487
|
EnforcedStyle: keyword
|
3475
3488
|
SupportedStyles:
|
3476
3489
|
- keyword
|
@@ -3479,7 +3492,7 @@ Style/MultilineMemoization:
|
|
3479
3492
|
Style/MultilineMethodSignature:
|
3480
3493
|
Description: 'Avoid multi-line method signatures.'
|
3481
3494
|
Enabled: false
|
3482
|
-
VersionAdded: 0.59
|
3495
|
+
VersionAdded: '0.59'
|
3483
3496
|
|
3484
3497
|
Style/MultilineTernaryOperator:
|
3485
3498
|
Description: >-
|
@@ -3487,19 +3500,19 @@ Style/MultilineTernaryOperator:
|
|
3487
3500
|
use if/unless instead.
|
3488
3501
|
StyleGuide: '#no-multiline-ternary'
|
3489
3502
|
Enabled: true
|
3490
|
-
VersionAdded: 0.9
|
3503
|
+
VersionAdded: '0.9'
|
3491
3504
|
|
3492
3505
|
Style/MultipleComparison:
|
3493
3506
|
Description: >-
|
3494
3507
|
Avoid comparing a variable with multiple items in a conditional,
|
3495
3508
|
use Array#include? instead.
|
3496
3509
|
Enabled: true
|
3497
|
-
VersionAdded: 0.49
|
3510
|
+
VersionAdded: '0.49'
|
3498
3511
|
|
3499
3512
|
Style/MutableConstant:
|
3500
3513
|
Description: 'Do not assign mutable objects to constants.'
|
3501
3514
|
Enabled: true
|
3502
|
-
VersionAdded: 0.34
|
3515
|
+
VersionAdded: '0.34'
|
3503
3516
|
|
3504
3517
|
Style/NegatedIf:
|
3505
3518
|
Description: >-
|
@@ -3507,8 +3520,8 @@ Style/NegatedIf:
|
|
3507
3520
|
(or control flow or).
|
3508
3521
|
StyleGuide: '#unless-for-negatives'
|
3509
3522
|
Enabled: true
|
3510
|
-
VersionAdded: 0.20
|
3511
|
-
VersionChanged: 0.48
|
3523
|
+
VersionAdded: '0.20'
|
3524
|
+
VersionChanged: '0.48'
|
3512
3525
|
EnforcedStyle: both
|
3513
3526
|
SupportedStyles:
|
3514
3527
|
# both: prefix and postfix negated `if` should both use `unless`
|
@@ -3522,21 +3535,21 @@ Style/NegatedWhile:
|
|
3522
3535
|
Description: 'Favor until over while for negative conditions.'
|
3523
3536
|
StyleGuide: '#until-for-negatives'
|
3524
3537
|
Enabled: true
|
3525
|
-
VersionAdded: 0.20
|
3538
|
+
VersionAdded: '0.20'
|
3526
3539
|
|
3527
3540
|
Style/NestedModifier:
|
3528
3541
|
Description: 'Avoid using nested modifiers.'
|
3529
3542
|
StyleGuide: '#no-nested-modifiers'
|
3530
3543
|
Enabled: true
|
3531
|
-
VersionAdded: 0.35
|
3544
|
+
VersionAdded: '0.35'
|
3532
3545
|
|
3533
3546
|
Style/NestedParenthesizedCalls:
|
3534
3547
|
Description: >-
|
3535
3548
|
Parenthesize method calls which are nested inside the
|
3536
3549
|
argument list of another parenthesized method call.
|
3537
3550
|
Enabled: true
|
3538
|
-
VersionAdded: 0.36
|
3539
|
-
VersionChanged: 0.50
|
3551
|
+
VersionAdded: '0.36'
|
3552
|
+
VersionChanged: '0.50'
|
3540
3553
|
Whitelist:
|
3541
3554
|
- be
|
3542
3555
|
- be_a
|
@@ -3560,14 +3573,14 @@ Style/NestedTernaryOperator:
|
|
3560
3573
|
Description: 'Use one expression per branch in a ternary operator.'
|
3561
3574
|
StyleGuide: '#no-nested-ternary'
|
3562
3575
|
Enabled: true
|
3563
|
-
VersionAdded: 0.9
|
3576
|
+
VersionAdded: '0.9'
|
3564
3577
|
|
3565
3578
|
Style/Next:
|
3566
3579
|
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
3567
3580
|
StyleGuide: '#no-nested-conditionals'
|
3568
3581
|
Enabled: true
|
3569
|
-
VersionAdded: 0.22
|
3570
|
-
VersionChanged: 0.35
|
3582
|
+
VersionAdded: '0.22'
|
3583
|
+
VersionChanged: '0.35'
|
3571
3584
|
# With `always` all conditions at the end of an iteration needs to be
|
3572
3585
|
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
3573
3586
|
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
|
@@ -3583,8 +3596,8 @@ Style/NilComparison:
|
|
3583
3596
|
Description: 'Prefer x.nil? to x == nil.'
|
3584
3597
|
StyleGuide: '#predicate-methods'
|
3585
3598
|
Enabled: true
|
3586
|
-
VersionAdded: 0.12
|
3587
|
-
VersionChanged: 0.59
|
3599
|
+
VersionAdded: '0.12'
|
3600
|
+
VersionChanged: '0.59'
|
3588
3601
|
EnforcedStyle: predicate
|
3589
3602
|
SupportedStyles:
|
3590
3603
|
- predicate
|
@@ -3594,8 +3607,8 @@ Style/NonNilCheck:
|
|
3594
3607
|
Description: 'Checks for redundant nil checks.'
|
3595
3608
|
StyleGuide: '#no-non-nil-checks'
|
3596
3609
|
Enabled: true
|
3597
|
-
VersionAdded: 0.20
|
3598
|
-
VersionChanged: 0.22
|
3610
|
+
VersionAdded: '0.20'
|
3611
|
+
VersionChanged: '0.22'
|
3599
3612
|
# With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
|
3600
3613
|
# `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
|
3601
3614
|
# **usually** OK, but might change behavior.
|
@@ -3608,14 +3621,14 @@ Style/Not:
|
|
3608
3621
|
Description: 'Use ! instead of not.'
|
3609
3622
|
StyleGuide: '#bang-not-not'
|
3610
3623
|
Enabled: true
|
3611
|
-
VersionAdded: 0.9
|
3612
|
-
VersionChanged: 0.20
|
3624
|
+
VersionAdded: '0.9'
|
3625
|
+
VersionChanged: '0.20'
|
3613
3626
|
|
3614
3627
|
Style/NumericLiteralPrefix:
|
3615
3628
|
Description: 'Use smallcase prefixes for numeric literals.'
|
3616
3629
|
StyleGuide: '#numeric-literal-prefixes'
|
3617
3630
|
Enabled: true
|
3618
|
-
VersionAdded: 0.41
|
3631
|
+
VersionAdded: '0.41'
|
3619
3632
|
EnforcedOctalStyle: zero_with_o
|
3620
3633
|
SupportedOctalStyles:
|
3621
3634
|
- zero_with_o
|
@@ -3628,8 +3641,8 @@ Style/NumericLiterals:
|
|
3628
3641
|
readability.
|
3629
3642
|
StyleGuide: '#underscores-in-numerics'
|
3630
3643
|
Enabled: true
|
3631
|
-
VersionAdded: 0.9
|
3632
|
-
VersionChanged: 0.48
|
3644
|
+
VersionAdded: '0.9'
|
3645
|
+
VersionChanged: '0.48'
|
3633
3646
|
MinDigits: 5
|
3634
3647
|
Strict: false
|
3635
3648
|
|
@@ -3645,8 +3658,8 @@ Style/NumericPredicate:
|
|
3645
3658
|
SafeAutoCorrect: false
|
3646
3659
|
AutoCorrect: false
|
3647
3660
|
Enabled: true
|
3648
|
-
VersionAdded: 0.42
|
3649
|
-
VersionChanged: 0.59
|
3661
|
+
VersionAdded: '0.42'
|
3662
|
+
VersionChanged: '0.59'
|
3650
3663
|
EnforcedStyle: predicate
|
3651
3664
|
SupportedStyles:
|
3652
3665
|
- predicate
|
@@ -3663,14 +3676,14 @@ Style/OneLineConditional:
|
|
3663
3676
|
if/then/else/end constructs.
|
3664
3677
|
StyleGuide: '#ternary-operator'
|
3665
3678
|
Enabled: true
|
3666
|
-
VersionAdded: 0.9
|
3667
|
-
VersionChanged: 0.38
|
3679
|
+
VersionAdded: '0.9'
|
3680
|
+
VersionChanged: '0.38'
|
3668
3681
|
|
3669
3682
|
Style/OptionHash:
|
3670
3683
|
Description: "Don't use option hashes when you can use keyword arguments."
|
3671
3684
|
Enabled: false
|
3672
|
-
VersionAdded: 0.33
|
3673
|
-
VersionChanged: 0.34
|
3685
|
+
VersionAdded: '0.33'
|
3686
|
+
VersionChanged: '0.34'
|
3674
3687
|
# A list of parameter names that will be flagged by this cop.
|
3675
3688
|
SuspiciousParamNames:
|
3676
3689
|
- options
|
@@ -3685,13 +3698,13 @@ Style/OptionalArguments:
|
|
3685
3698
|
of the argument list
|
3686
3699
|
StyleGuide: '#optional-arguments'
|
3687
3700
|
Enabled: true
|
3688
|
-
VersionAdded: 0.33
|
3701
|
+
VersionAdded: '0.33'
|
3689
3702
|
|
3690
3703
|
Style/OrAssignment:
|
3691
3704
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
3692
3705
|
StyleGuide: '#double-pipe-for-uninit'
|
3693
3706
|
Enabled: true
|
3694
|
-
VersionAdded: 0.50
|
3707
|
+
VersionAdded: '0.50'
|
3695
3708
|
|
3696
3709
|
Style/ParallelAssignment:
|
3697
3710
|
Description: >-
|
@@ -3700,7 +3713,7 @@ Style/ParallelAssignment:
|
|
3700
3713
|
matches on both sides of the assignment.
|
3701
3714
|
StyleGuide: '#parallel-assignment'
|
3702
3715
|
Enabled: true
|
3703
|
-
VersionAdded: 0.32
|
3716
|
+
VersionAdded: '0.32'
|
3704
3717
|
|
3705
3718
|
Style/ParenthesesAroundCondition:
|
3706
3719
|
Description: >-
|
@@ -3708,8 +3721,8 @@ Style/ParenthesesAroundCondition:
|
|
3708
3721
|
if/unless/while.
|
3709
3722
|
StyleGuide: '#no-parens-around-condition'
|
3710
3723
|
Enabled: true
|
3711
|
-
VersionAdded: 0.9
|
3712
|
-
VersionChanged: 0.56
|
3724
|
+
VersionAdded: '0.9'
|
3725
|
+
VersionChanged: '0.56'
|
3713
3726
|
AllowSafeAssignment: true
|
3714
3727
|
AllowInMultilineConditions: false
|
3715
3728
|
|
@@ -3717,7 +3730,7 @@ Style/PercentLiteralDelimiters:
|
|
3717
3730
|
Description: 'Use `%`-literal delimiters consistently'
|
3718
3731
|
StyleGuide: '#percent-literal-braces'
|
3719
3732
|
Enabled: true
|
3720
|
-
VersionAdded: 0.19
|
3733
|
+
VersionAdded: '0.19'
|
3721
3734
|
# Specify the default preferred delimiter for all types with the 'default' key
|
3722
3735
|
# Override individual delimiters (even with default specified) by specifying
|
3723
3736
|
# an individual key
|
@@ -3728,12 +3741,12 @@ Style/PercentLiteralDelimiters:
|
|
3728
3741
|
'%r': '{}'
|
3729
3742
|
'%w': '[]'
|
3730
3743
|
'%W': '[]'
|
3731
|
-
VersionChanged: 0.48.1
|
3744
|
+
VersionChanged: '0.48.1'
|
3732
3745
|
|
3733
3746
|
Style/PercentQLiterals:
|
3734
3747
|
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
3735
3748
|
Enabled: true
|
3736
|
-
VersionAdded: 0.25
|
3749
|
+
VersionAdded: '0.25'
|
3737
3750
|
EnforcedStyle: lower_case_q
|
3738
3751
|
SupportedStyles:
|
3739
3752
|
- lower_case_q # Use `%q` when possible, `%Q` when necessary
|
@@ -3743,14 +3756,14 @@ Style/PerlBackrefs:
|
|
3743
3756
|
Description: 'Avoid Perl-style regex back references.'
|
3744
3757
|
StyleGuide: '#no-perl-regexp-last-matchers'
|
3745
3758
|
Enabled: true
|
3746
|
-
VersionAdded: 0.13
|
3759
|
+
VersionAdded: '0.13'
|
3747
3760
|
|
3748
3761
|
Style/PreferredHashMethods:
|
3749
3762
|
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
3750
3763
|
StyleGuide: '#hash-key'
|
3751
3764
|
Enabled: true
|
3752
|
-
VersionAdded: 0.41
|
3753
|
-
VersionChanged: 0.44
|
3765
|
+
VersionAdded: '0.41'
|
3766
|
+
VersionChanged: '0.44'
|
3754
3767
|
EnforcedStyle: short
|
3755
3768
|
SupportedStyles:
|
3756
3769
|
- short
|
@@ -3760,15 +3773,15 @@ Style/Proc:
|
|
3760
3773
|
Description: 'Use proc instead of Proc.new.'
|
3761
3774
|
StyleGuide: '#proc'
|
3762
3775
|
Enabled: true
|
3763
|
-
VersionAdded: 0.9
|
3764
|
-
VersionChanged: 0.18
|
3776
|
+
VersionAdded: '0.9'
|
3777
|
+
VersionChanged: '0.18'
|
3765
3778
|
|
3766
3779
|
Style/RaiseArgs:
|
3767
3780
|
Description: 'Checks the arguments passed to raise/fail.'
|
3768
3781
|
StyleGuide: '#exception-class-messages'
|
3769
3782
|
Enabled: true
|
3770
|
-
VersionAdded: 0.14
|
3771
|
-
VersionChanged: 0.40
|
3783
|
+
VersionAdded: '0.14'
|
3784
|
+
VersionChanged: '0.40'
|
3772
3785
|
EnforcedStyle: exploded
|
3773
3786
|
SupportedStyles:
|
3774
3787
|
- compact # raise Exception.new(msg)
|
@@ -3780,43 +3793,43 @@ Style/RandomWithOffset:
|
|
3780
3793
|
integers with offsets.
|
3781
3794
|
StyleGuide: '#random-numbers'
|
3782
3795
|
Enabled: true
|
3783
|
-
VersionAdded: 0.52
|
3796
|
+
VersionAdded: '0.52'
|
3784
3797
|
|
3785
3798
|
Style/RedundantBegin:
|
3786
3799
|
Description: "Don't use begin blocks when they are not needed."
|
3787
3800
|
StyleGuide: '#begin-implicit'
|
3788
3801
|
Enabled: true
|
3789
|
-
VersionAdded: 0.10
|
3790
|
-
VersionChanged: 0.21
|
3802
|
+
VersionAdded: '0.10'
|
3803
|
+
VersionChanged: '0.21'
|
3791
3804
|
|
3792
3805
|
Style/RedundantConditional:
|
3793
3806
|
Description: "Don't return true/false from a conditional."
|
3794
3807
|
Enabled: true
|
3795
|
-
VersionAdded: 0.50
|
3808
|
+
VersionAdded: '0.50'
|
3796
3809
|
|
3797
3810
|
Style/RedundantException:
|
3798
3811
|
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
3799
3812
|
StyleGuide: '#no-explicit-runtimeerror'
|
3800
3813
|
Enabled: true
|
3801
|
-
VersionAdded: 0.14
|
3802
|
-
VersionChanged: 0.29
|
3814
|
+
VersionAdded: '0.14'
|
3815
|
+
VersionChanged: '0.29'
|
3803
3816
|
|
3804
3817
|
Style/RedundantFreeze:
|
3805
3818
|
Description: "Checks usages of Object#freeze on immutable objects."
|
3806
3819
|
Enabled: true
|
3807
|
-
VersionAdded: 0.34
|
3820
|
+
VersionAdded: '0.34'
|
3808
3821
|
|
3809
3822
|
Style/RedundantParentheses:
|
3810
3823
|
Description: "Checks for parentheses that seem not to serve any purpose."
|
3811
3824
|
Enabled: true
|
3812
|
-
VersionAdded: 0.36
|
3825
|
+
VersionAdded: '0.36'
|
3813
3826
|
|
3814
3827
|
Style/RedundantReturn:
|
3815
3828
|
Description: "Don't use return where it's not required."
|
3816
3829
|
StyleGuide: '#no-explicit-return'
|
3817
3830
|
Enabled: true
|
3818
|
-
VersionAdded: 0.10
|
3819
|
-
VersionChanged: 0.14
|
3831
|
+
VersionAdded: '0.10'
|
3832
|
+
VersionChanged: '0.14'
|
3820
3833
|
# When `true` allows code like `return x, y`.
|
3821
3834
|
AllowMultipleReturnValues: false
|
3822
3835
|
|
@@ -3824,15 +3837,15 @@ Style/RedundantSelf:
|
|
3824
3837
|
Description: "Don't use self where it's not needed."
|
3825
3838
|
StyleGuide: '#no-self-unless-required'
|
3826
3839
|
Enabled: true
|
3827
|
-
VersionAdded: 0.10
|
3828
|
-
VersionChanged: 0.13
|
3840
|
+
VersionAdded: '0.10'
|
3841
|
+
VersionChanged: '0.13'
|
3829
3842
|
|
3830
3843
|
Style/RegexpLiteral:
|
3831
3844
|
Description: 'Use / or %r around regular expressions.'
|
3832
3845
|
StyleGuide: '#percent-r'
|
3833
3846
|
Enabled: true
|
3834
|
-
VersionAdded: 0.9
|
3835
|
-
VersionChanged: 0.30
|
3847
|
+
VersionAdded: '0.9'
|
3848
|
+
VersionChanged: '0.30'
|
3836
3849
|
EnforcedStyle: slashes
|
3837
3850
|
# slashes: Always use slashes.
|
3838
3851
|
# percent_r: Always use `%r`.
|
@@ -3849,13 +3862,13 @@ Style/RescueModifier:
|
|
3849
3862
|
Description: 'Avoid using rescue in its modifier form.'
|
3850
3863
|
StyleGuide: '#no-rescue-modifiers'
|
3851
3864
|
Enabled: true
|
3852
|
-
VersionAdded: 0.9
|
3853
|
-
VersionChanged: 0.34
|
3865
|
+
VersionAdded: '0.9'
|
3866
|
+
VersionChanged: '0.34'
|
3854
3867
|
|
3855
3868
|
Style/RescueStandardError:
|
3856
3869
|
Description: 'Avoid rescuing without specifying an error class.'
|
3857
3870
|
Enabled: true
|
3858
|
-
VersionAdded: 0.52
|
3871
|
+
VersionAdded: '0.52'
|
3859
3872
|
EnforcedStyle: explicit
|
3860
3873
|
# implicit: Do not include the error class, `rescue`
|
3861
3874
|
# explicit: Require an error class `rescue StandardError`
|
@@ -3870,7 +3883,7 @@ Style/ReturnNil:
|
|
3870
3883
|
SupportedStyles:
|
3871
3884
|
- return
|
3872
3885
|
- return_nil
|
3873
|
-
VersionAdded: 0.50
|
3886
|
+
VersionAdded: '0.50'
|
3874
3887
|
|
3875
3888
|
Style/SafeNavigation:
|
3876
3889
|
Description: >-
|
@@ -3878,8 +3891,8 @@ Style/SafeNavigation:
|
|
3878
3891
|
a check for the existence of the object to
|
3879
3892
|
safe navigation (`&.`).
|
3880
3893
|
Enabled: true
|
3881
|
-
VersionAdded: 0.43
|
3882
|
-
VersionChanged: 0.44
|
3894
|
+
VersionAdded: '0.43'
|
3895
|
+
VersionChanged: '0.44'
|
3883
3896
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
3884
3897
|
# to whatever it used to return.
|
3885
3898
|
ConvertCodeThatCanStartToReturnNil: false
|
@@ -3889,7 +3902,7 @@ Style/SafeNavigation:
|
|
3889
3902
|
- presence
|
3890
3903
|
- try
|
3891
3904
|
- try!
|
3892
|
-
VersionChanged: 0.56
|
3905
|
+
VersionChanged: '0.56'
|
3893
3906
|
|
3894
3907
|
Style/SelfAssignment:
|
3895
3908
|
Description: >-
|
@@ -3897,15 +3910,15 @@ Style/SelfAssignment:
|
|
3897
3910
|
been used.
|
3898
3911
|
StyleGuide: '#self-assignment'
|
3899
3912
|
Enabled: true
|
3900
|
-
VersionAdded: 0.19
|
3901
|
-
VersionChanged: 0.29
|
3913
|
+
VersionAdded: '0.19'
|
3914
|
+
VersionChanged: '0.29'
|
3902
3915
|
|
3903
3916
|
Style/Semicolon:
|
3904
3917
|
Description: "Don't use semicolons to terminate expressions."
|
3905
3918
|
StyleGuide: '#no-semicolon'
|
3906
3919
|
Enabled: true
|
3907
|
-
VersionAdded: 0.9
|
3908
|
-
VersionChanged: 0.19
|
3920
|
+
VersionAdded: '0.9'
|
3921
|
+
VersionChanged: '0.19'
|
3909
3922
|
# Allow `;` to separate several expressions on the same line.
|
3910
3923
|
AllowAsExpressionSeparator: false
|
3911
3924
|
|
@@ -3913,14 +3926,14 @@ Style/Send:
|
|
3913
3926
|
Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.'
|
3914
3927
|
StyleGuide: '#prefer-public-send'
|
3915
3928
|
Enabled: false
|
3916
|
-
VersionAdded: 0.33
|
3929
|
+
VersionAdded: '0.33'
|
3917
3930
|
|
3918
3931
|
Style/SignalException:
|
3919
3932
|
Description: 'Checks for proper usage of fail and raise.'
|
3920
3933
|
StyleGuide: '#prefer-raise-over-fail'
|
3921
3934
|
Enabled: true
|
3922
|
-
VersionAdded: 0.11
|
3923
|
-
VersionChanged: 0.37
|
3935
|
+
VersionAdded: '0.11'
|
3936
|
+
VersionChanged: '0.37'
|
3924
3937
|
EnforcedStyle: only_raise
|
3925
3938
|
SupportedStyles:
|
3926
3939
|
- only_raise
|
@@ -3930,8 +3943,8 @@ Style/SignalException:
|
|
3930
3943
|
Style/SingleLineBlockParams:
|
3931
3944
|
Description: 'Enforces the names of some block params.'
|
3932
3945
|
Enabled: false
|
3933
|
-
VersionAdded: 0.16
|
3934
|
-
VersionChanged: 0.47
|
3946
|
+
VersionAdded: '0.16'
|
3947
|
+
VersionChanged: '0.47'
|
3935
3948
|
Methods:
|
3936
3949
|
- reduce:
|
3937
3950
|
- acc
|
@@ -3944,16 +3957,16 @@ Style/SingleLineMethods:
|
|
3944
3957
|
Description: 'Avoid single-line methods.'
|
3945
3958
|
StyleGuide: '#no-single-line-methods'
|
3946
3959
|
Enabled: true
|
3947
|
-
VersionAdded: 0.9
|
3948
|
-
VersionChanged: 0.19
|
3960
|
+
VersionAdded: '0.9'
|
3961
|
+
VersionChanged: '0.19'
|
3949
3962
|
AllowIfMethodIsEmpty: true
|
3950
3963
|
|
3951
3964
|
Style/SpecialGlobalVars:
|
3952
3965
|
Description: 'Avoid Perl-style global variables.'
|
3953
3966
|
StyleGuide: '#no-cryptic-perlisms'
|
3954
3967
|
Enabled: true
|
3955
|
-
VersionAdded: 0.13
|
3956
|
-
VersionChanged: 0.36
|
3968
|
+
VersionAdded: '0.13'
|
3969
|
+
VersionChanged: '0.36'
|
3957
3970
|
SafeAutoCorrect: false
|
3958
3971
|
EnforcedStyle: use_english_names
|
3959
3972
|
SupportedStyles:
|
@@ -3964,7 +3977,7 @@ Style/StabbyLambdaParentheses:
|
|
3964
3977
|
Description: 'Check for the usage of parentheses around stabby lambda arguments.'
|
3965
3978
|
StyleGuide: '#stabby-lambda-with-args'
|
3966
3979
|
Enabled: true
|
3967
|
-
VersionAdded: 0.35
|
3980
|
+
VersionAdded: '0.35'
|
3968
3981
|
EnforcedStyle: require_parentheses
|
3969
3982
|
SupportedStyles:
|
3970
3983
|
- require_parentheses
|
@@ -3974,20 +3987,20 @@ Style/StderrPuts:
|
|
3974
3987
|
Description: 'Use `warn` instead of `$stderr.puts`.'
|
3975
3988
|
StyleGuide: '#warn'
|
3976
3989
|
Enabled: true
|
3977
|
-
VersionAdded: 0.51
|
3990
|
+
VersionAdded: '0.51'
|
3978
3991
|
|
3979
3992
|
Style/StringHashKeys:
|
3980
3993
|
Description: 'Prefer symbols instead of strings as hash keys.'
|
3981
3994
|
StyleGuide: '#symbols-as-keys'
|
3982
3995
|
Enabled: false
|
3983
|
-
VersionAdded: 0.52
|
3996
|
+
VersionAdded: '0.52'
|
3984
3997
|
|
3985
3998
|
Style/StringLiterals:
|
3986
3999
|
Description: 'Checks if uses of quotes match the configured preference.'
|
3987
4000
|
StyleGuide: '#consistent-string-literals'
|
3988
4001
|
Enabled: true
|
3989
|
-
VersionAdded: 0.9
|
3990
|
-
VersionChanged: 0.36
|
4002
|
+
VersionAdded: '0.9'
|
4003
|
+
VersionChanged: '0.36'
|
3991
4004
|
EnforcedStyle: single_quotes
|
3992
4005
|
SupportedStyles:
|
3993
4006
|
- single_quotes
|
@@ -4001,7 +4014,7 @@ Style/StringLiteralsInInterpolation:
|
|
4001
4014
|
Checks if uses of quotes inside expressions in interpolated
|
4002
4015
|
strings match the configured preference.
|
4003
4016
|
Enabled: true
|
4004
|
-
VersionAdded: 0.27
|
4017
|
+
VersionAdded: '0.27'
|
4005
4018
|
EnforcedStyle: single_quotes
|
4006
4019
|
SupportedStyles:
|
4007
4020
|
- single_quotes
|
@@ -4010,8 +4023,8 @@ Style/StringLiteralsInInterpolation:
|
|
4010
4023
|
Style/StringMethods:
|
4011
4024
|
Description: 'Checks if configured preferred methods are used over non-preferred.'
|
4012
4025
|
Enabled: false
|
4013
|
-
VersionAdded: 0.34
|
4014
|
-
VersionChanged: 0.34.2
|
4026
|
+
VersionAdded: '0.34'
|
4027
|
+
VersionChanged: '0.34.2'
|
4015
4028
|
# Mapping from undesired method to desired_method
|
4016
4029
|
# e.g. to use `to_sym` over `intern`:
|
4017
4030
|
#
|
@@ -4025,14 +4038,14 @@ Style/StructInheritance:
|
|
4025
4038
|
Description: 'Checks for inheritance from Struct.new.'
|
4026
4039
|
StyleGuide: '#no-extend-struct-new'
|
4027
4040
|
Enabled: true
|
4028
|
-
VersionAdded: 0.29
|
4041
|
+
VersionAdded: '0.29'
|
4029
4042
|
|
4030
4043
|
Style/SymbolArray:
|
4031
4044
|
Description: 'Use %i or %I for arrays of symbols.'
|
4032
4045
|
StyleGuide: '#percent-i'
|
4033
4046
|
Enabled: true
|
4034
|
-
VersionAdded: 0.9
|
4035
|
-
VersionChanged: 0.49
|
4047
|
+
VersionAdded: '0.9'
|
4048
|
+
VersionChanged: '0.49'
|
4036
4049
|
EnforcedStyle: percent
|
4037
4050
|
MinSize: 2
|
4038
4051
|
SupportedStyles:
|
@@ -4042,13 +4055,13 @@ Style/SymbolArray:
|
|
4042
4055
|
Style/SymbolLiteral:
|
4043
4056
|
Description: 'Use plain symbols instead of string symbols when possible.'
|
4044
4057
|
Enabled: true
|
4045
|
-
VersionAdded: 0.30
|
4058
|
+
VersionAdded: '0.30'
|
4046
4059
|
|
4047
4060
|
Style/SymbolProc:
|
4048
4061
|
Description: 'Use symbols as procs instead of blocks when possible.'
|
4049
4062
|
Enabled: true
|
4050
|
-
VersionAdded: 0.26
|
4051
|
-
VersionChanged: 0.40
|
4063
|
+
VersionAdded: '0.26'
|
4064
|
+
VersionChanged: '0.40'
|
4052
4065
|
# A list of method names to be ignored by the check.
|
4053
4066
|
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
4054
4067
|
IgnoredMethods:
|
@@ -4058,8 +4071,8 @@ Style/SymbolProc:
|
|
4058
4071
|
Style/TernaryParentheses:
|
4059
4072
|
Description: 'Checks for use of parentheses around ternary conditions.'
|
4060
4073
|
Enabled: true
|
4061
|
-
VersionAdded: 0.42
|
4062
|
-
VersionChanged: 0.46
|
4074
|
+
VersionAdded: '0.42'
|
4075
|
+
VersionChanged: '0.46'
|
4063
4076
|
EnforcedStyle: require_no_parentheses
|
4064
4077
|
SupportedStyles:
|
4065
4078
|
- require_parentheses
|
@@ -4070,23 +4083,23 @@ Style/TernaryParentheses:
|
|
4070
4083
|
Style/TrailingBodyOnClass:
|
4071
4084
|
Description: 'Class body goes below class statement.'
|
4072
4085
|
Enabled: true
|
4073
|
-
VersionAdded: 0.53
|
4086
|
+
VersionAdded: '0.53'
|
4074
4087
|
|
4075
4088
|
Style/TrailingBodyOnMethodDefinition:
|
4076
4089
|
Description: 'Method body goes below definition.'
|
4077
4090
|
Enabled: true
|
4078
|
-
VersionAdded: 0.52
|
4091
|
+
VersionAdded: '0.52'
|
4079
4092
|
|
4080
4093
|
Style/TrailingBodyOnModule:
|
4081
4094
|
Description: 'Module body goes below module statement.'
|
4082
4095
|
Enabled: true
|
4083
|
-
VersionAdded: 0.53
|
4096
|
+
VersionAdded: '0.53'
|
4084
4097
|
|
4085
4098
|
Style/TrailingCommaInArguments:
|
4086
4099
|
Description: 'Checks for trailing comma in argument lists.'
|
4087
4100
|
StyleGuide: '#no-trailing-params-comma'
|
4088
4101
|
Enabled: true
|
4089
|
-
VersionAdded: 0.36
|
4102
|
+
VersionAdded: '0.36'
|
4090
4103
|
# If `comma`, the cop requires a comma after the last argument, but only for
|
4091
4104
|
# parenthesized method calls where each argument is on its own line.
|
4092
4105
|
# If `consistent_comma`, the cop requires a comma after the last argument,
|
@@ -4101,7 +4114,7 @@ Style/TrailingCommaInArrayLiteral:
|
|
4101
4114
|
Description: 'Checks for trailing comma in array literals.'
|
4102
4115
|
StyleGuide: '#no-trailing-array-commas'
|
4103
4116
|
Enabled: true
|
4104
|
-
VersionAdded: 0.53
|
4117
|
+
VersionAdded: '0.53'
|
4105
4118
|
# but only when each item is on its own line.
|
4106
4119
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
4107
4120
|
# non-empty array literals.
|
@@ -4123,12 +4136,12 @@ Style/TrailingCommaInHashLiteral:
|
|
4123
4136
|
- comma
|
4124
4137
|
- consistent_comma
|
4125
4138
|
- no_comma
|
4126
|
-
VersionAdded: 0.53
|
4139
|
+
VersionAdded: '0.53'
|
4127
4140
|
|
4128
4141
|
Style/TrailingMethodEndStatement:
|
4129
4142
|
Description: 'Checks for trailing end statement on line of method body.'
|
4130
4143
|
Enabled: true
|
4131
|
-
VersionAdded: 0.52
|
4144
|
+
VersionAdded: '0.52'
|
4132
4145
|
|
4133
4146
|
Style/TrailingUnderscoreVariable:
|
4134
4147
|
Description: >-
|
@@ -4136,8 +4149,8 @@ Style/TrailingUnderscoreVariable:
|
|
4136
4149
|
end of parallel variable assignment.
|
4137
4150
|
AllowNamedUnderscoreVariables: true
|
4138
4151
|
Enabled: true
|
4139
|
-
VersionAdded: 0.31
|
4140
|
-
VersionChanged: 0.35
|
4152
|
+
VersionAdded: '0.31'
|
4153
|
+
VersionChanged: '0.35'
|
4141
4154
|
|
4142
4155
|
# `TrivialAccessors` requires exact name matches and doesn't allow
|
4143
4156
|
# predicated methods by default.
|
@@ -4145,8 +4158,8 @@ Style/TrivialAccessors:
|
|
4145
4158
|
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
4146
4159
|
StyleGuide: '#attr_family'
|
4147
4160
|
Enabled: true
|
4148
|
-
VersionAdded: 0.9
|
4149
|
-
VersionChanged: 0.38
|
4161
|
+
VersionAdded: '0.9'
|
4162
|
+
VersionChanged: '0.38'
|
4150
4163
|
# When set to `false` the cop will suggest the use of accessor methods
|
4151
4164
|
# in situations like:
|
4152
4165
|
#
|
@@ -4192,36 +4205,36 @@ Style/UnlessElse:
|
|
4192
4205
|
case first.
|
4193
4206
|
StyleGuide: '#no-else-with-unless'
|
4194
4207
|
Enabled: true
|
4195
|
-
VersionAdded: 0.9
|
4208
|
+
VersionAdded: '0.9'
|
4196
4209
|
|
4197
4210
|
Style/UnneededCapitalW:
|
4198
4211
|
Description: 'Checks for %W when interpolation is not needed.'
|
4199
4212
|
Enabled: true
|
4200
|
-
VersionAdded: 0.21
|
4201
|
-
VersionChanged: 0.24
|
4213
|
+
VersionAdded: '0.21'
|
4214
|
+
VersionChanged: '0.24'
|
4202
4215
|
|
4203
4216
|
Style/UnneededCondition:
|
4204
4217
|
Description: 'Checks for unnecessary conditional expressions.'
|
4205
4218
|
Enabled: true
|
4206
|
-
VersionAdded: 0.57
|
4219
|
+
VersionAdded: '0.57'
|
4207
4220
|
|
4208
4221
|
Style/UnneededInterpolation:
|
4209
4222
|
Description: 'Checks for strings that are just an interpolated expression.'
|
4210
4223
|
Enabled: true
|
4211
|
-
VersionAdded: 0.36
|
4224
|
+
VersionAdded: '0.36'
|
4212
4225
|
|
4213
4226
|
Style/UnneededPercentQ:
|
4214
4227
|
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
4215
4228
|
StyleGuide: '#percent-q'
|
4216
4229
|
Enabled: true
|
4217
|
-
VersionAdded: 0.24
|
4230
|
+
VersionAdded: '0.24'
|
4218
4231
|
|
4219
4232
|
Style/UnpackFirst:
|
4220
4233
|
Description: >-
|
4221
4234
|
Checks for accessing the first element of `String#unpack`
|
4222
4235
|
instead of using `unpack1`
|
4223
4236
|
Enabled: true
|
4224
|
-
VersionAdded: 0.54
|
4237
|
+
VersionAdded: '0.54'
|
4225
4238
|
|
4226
4239
|
Style/VariableInterpolation:
|
4227
4240
|
Description: >-
|
@@ -4229,20 +4242,20 @@ Style/VariableInterpolation:
|
|
4229
4242
|
directly in strings.
|
4230
4243
|
StyleGuide: '#curlies-interpolate'
|
4231
4244
|
Enabled: true
|
4232
|
-
VersionAdded: 0.9
|
4233
|
-
VersionChanged: 0.20
|
4245
|
+
VersionAdded: '0.9'
|
4246
|
+
VersionChanged: '0.20'
|
4234
4247
|
|
4235
4248
|
Style/WhenThen:
|
4236
4249
|
Description: 'Use when x then ... for one-line cases.'
|
4237
4250
|
StyleGuide: '#one-line-cases'
|
4238
4251
|
Enabled: true
|
4239
|
-
VersionAdded: 0.9
|
4252
|
+
VersionAdded: '0.9'
|
4240
4253
|
|
4241
4254
|
Style/WhileUntilDo:
|
4242
4255
|
Description: 'Checks for redundant do after while or until.'
|
4243
4256
|
StyleGuide: '#no-multiline-while-do'
|
4244
4257
|
Enabled: true
|
4245
|
-
VersionAdded: 0.9
|
4258
|
+
VersionAdded: '0.9'
|
4246
4259
|
|
4247
4260
|
Style/WhileUntilModifier:
|
4248
4261
|
Description: >-
|
@@ -4250,15 +4263,15 @@ Style/WhileUntilModifier:
|
|
4250
4263
|
single-line body.
|
4251
4264
|
StyleGuide: '#while-as-a-modifier'
|
4252
4265
|
Enabled: true
|
4253
|
-
VersionAdded: 0.9
|
4254
|
-
VersionChanged: 0.30
|
4266
|
+
VersionAdded: '0.9'
|
4267
|
+
VersionChanged: '0.30'
|
4255
4268
|
|
4256
4269
|
Style/WordArray:
|
4257
4270
|
Description: 'Use %w or %W for arrays of words.'
|
4258
4271
|
StyleGuide: '#percent-w'
|
4259
4272
|
Enabled: true
|
4260
|
-
VersionAdded: 0.9
|
4261
|
-
VersionChanged: 0.36
|
4273
|
+
VersionAdded: '0.9'
|
4274
|
+
VersionChanged: '0.36'
|
4262
4275
|
EnforcedStyle: percent
|
4263
4276
|
SupportedStyles:
|
4264
4277
|
# percent style: %w(word1 word2)
|
@@ -4282,12 +4295,12 @@ Style/YodaCondition:
|
|
4282
4295
|
- all_comparison_operators
|
4283
4296
|
# check only equality operators: `!=` and `==`
|
4284
4297
|
- equality_operators_only
|
4285
|
-
VersionAdded: 0.49
|
4286
|
-
VersionChanged: 0.50
|
4298
|
+
VersionAdded: '0.49'
|
4299
|
+
VersionChanged: '0.50'
|
4287
4300
|
|
4288
4301
|
Style/ZeroLengthPredicate:
|
4289
4302
|
Description: 'Use #empty? when testing for objects of length 0.'
|
4290
4303
|
Enabled: true
|
4291
4304
|
Safe: false
|
4292
|
-
VersionAdded: 0.37
|
4293
|
-
VersionChanged: 0.39
|
4305
|
+
VersionAdded: '0.37'
|
4306
|
+
VersionChanged: '0.39'
|