docquet 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/config/cops/style.yml +1 -1
- data/config/defaults/bundler.yml +2 -2
- data/config/defaults/capybara.yml +70 -56
- data/config/defaults/capybara_rspec.yml +91 -4
- data/config/defaults/i18n_railsi18n.yml +1 -1
- data/config/defaults/layout.yml +22 -9
- data/config/defaults/lint.yml +108 -21
- data/config/defaults/metrics.yml +9 -7
- data/config/defaults/migration.yml +2 -2
- data/config/defaults/naming.yml +6 -3
- data/config/defaults/rspec.yml +33 -2
- data/config/defaults/security.yml +4 -5
- data/config/defaults/style.yml +217 -41
- data/config/defaults/thread_safety.yml +27 -1
- data/lib/docquet/version.rb +1 -1
- metadata +4 -4
data/config/defaults/style.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Department 'Style' (
|
|
1
|
+
# Department 'Style' (299):
|
|
2
2
|
# Supports --autocorrect
|
|
3
3
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleaccessmodifierdeclarations
|
|
4
4
|
Style/AccessModifierDeclarations:
|
|
@@ -67,6 +67,8 @@ Style/ArgumentsForwarding:
|
|
|
67
67
|
Description: Use arguments forwarding.
|
|
68
68
|
StyleGuide: "#arguments-forwarding"
|
|
69
69
|
Enabled: true # was pending
|
|
70
|
+
VersionAdded: '1.1'
|
|
71
|
+
VersionChanged: '1.58'
|
|
70
72
|
UseAnonymousForwarding: true
|
|
71
73
|
RedundantRestArgumentNames:
|
|
72
74
|
- args
|
|
@@ -79,8 +81,6 @@ Style/ArgumentsForwarding:
|
|
|
79
81
|
- blk
|
|
80
82
|
- block
|
|
81
83
|
- proc
|
|
82
|
-
VersionAdded: '1.1'
|
|
83
|
-
VersionChanged: '1.58'
|
|
84
84
|
|
|
85
85
|
# Supports --autocorrect
|
|
86
86
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylearraycoercion
|
|
@@ -96,6 +96,7 @@ Style/ArrayCoercion:
|
|
|
96
96
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylearrayfirstlast
|
|
97
97
|
Style/ArrayFirstLast:
|
|
98
98
|
Description: Use `arr.first` and `arr.last` instead of `arr[0]` and `arr[-1]`.
|
|
99
|
+
StyleGuide: "#first-and-last"
|
|
99
100
|
References:
|
|
100
101
|
- "#first-and-last"
|
|
101
102
|
Enabled: true # was false
|
|
@@ -278,7 +279,7 @@ Style/ClassAndModuleChildren:
|
|
|
278
279
|
SafeAutoCorrect: false
|
|
279
280
|
Enabled: true
|
|
280
281
|
VersionAdded: '0.19'
|
|
281
|
-
VersionChanged: '1.
|
|
282
|
+
VersionChanged: '1.89'
|
|
282
283
|
EnforcedStyle: nested
|
|
283
284
|
SupportedStyles:
|
|
284
285
|
- nested
|
|
@@ -365,7 +366,7 @@ Style/CollectionCompact:
|
|
|
365
366
|
# Supports --autocorrect
|
|
366
367
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylecollectionmethods
|
|
367
368
|
Style/CollectionMethods:
|
|
368
|
-
Description:
|
|
369
|
+
Description: Enforces the use of consistent method names from the `Enumerable` module.
|
|
369
370
|
StyleGuide: "#map-find-select-reduce-include-size"
|
|
370
371
|
Enabled: true # was false
|
|
371
372
|
VersionAdded: '0.9'
|
|
@@ -390,6 +391,7 @@ Style/CollectionQuerying:
|
|
|
390
391
|
StyleGuide: "#collection-querying"
|
|
391
392
|
Enabled: true # was pending
|
|
392
393
|
VersionAdded: '1.77'
|
|
394
|
+
VersionChanged: '1.92'
|
|
393
395
|
Safe: false
|
|
394
396
|
|
|
395
397
|
# Supports --autocorrect
|
|
@@ -470,11 +472,11 @@ Style/CommentedKeyword:
|
|
|
470
472
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylecomparablebetween
|
|
471
473
|
Style/ComparableBetween:
|
|
472
474
|
Description: Enforces the use of `Comparable#between?` instead of logical comparison.
|
|
475
|
+
StyleGuide: "#ranges-or-between"
|
|
473
476
|
Enabled: true # was pending
|
|
474
477
|
Safe: false
|
|
475
478
|
VersionAdded: '1.74'
|
|
476
479
|
VersionChanged: '1.75'
|
|
477
|
-
StyleGuide: "#ranges-or-between"
|
|
478
480
|
|
|
479
481
|
# Supports --autocorrect
|
|
480
482
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylecomparableclamp
|
|
@@ -499,6 +501,7 @@ Style/ConditionalAssignment:
|
|
|
499
501
|
Description: Use the return value of `if` and `case` statements for assignment to
|
|
500
502
|
a variable and variable comparison instead of assigning that variable inside of
|
|
501
503
|
each branch.
|
|
504
|
+
StyleGuide: "#use-if-case-returns"
|
|
502
505
|
Enabled: true
|
|
503
506
|
VersionAdded: '0.36'
|
|
504
507
|
VersionChanged: '0.47'
|
|
@@ -540,7 +543,7 @@ Style/DataInheritance:
|
|
|
540
543
|
# https://docs.rubocop.org/rubocop/cops_style.html#styledatetime
|
|
541
544
|
Style/DateTime:
|
|
542
545
|
Description: Use Time over DateTime.
|
|
543
|
-
StyleGuide: "#
|
|
546
|
+
StyleGuide: "#no-datetime"
|
|
544
547
|
Enabled: true # was false
|
|
545
548
|
VersionAdded: '0.51'
|
|
546
549
|
VersionChanged: '0.92'
|
|
@@ -580,14 +583,27 @@ Style/DirEmpty:
|
|
|
580
583
|
Enabled: true # was pending
|
|
581
584
|
VersionAdded: '1.48'
|
|
582
585
|
|
|
586
|
+
# Supports --autocorrect
|
|
587
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledirectivescope
|
|
588
|
+
Style/DirectiveScope:
|
|
589
|
+
Description: Checks for directive scopes that can be expressed with the tighter `disable-next`
|
|
590
|
+
form.
|
|
591
|
+
Enabled: true # was pending
|
|
592
|
+
SafeAutoCorrect: false
|
|
593
|
+
VersionAdded: '1.90'
|
|
594
|
+
VersionChanged: '1.91'
|
|
595
|
+
|
|
583
596
|
# Supports --autocorrect
|
|
584
597
|
# https://docs.rubocop.org/rubocop/cops_style.html#styledisablecopswithinsourcecodedirective
|
|
585
598
|
Style/DisableCopsWithinSourceCodeDirective:
|
|
586
599
|
Description: Forbids disabling/enabling cops within source code.
|
|
587
600
|
Enabled: true # was false
|
|
588
601
|
VersionAdded: '0.82'
|
|
589
|
-
VersionChanged: '1.
|
|
602
|
+
VersionChanged: '1.92'
|
|
590
603
|
AllowedCops: []
|
|
604
|
+
DisallowedCops: []
|
|
605
|
+
AllowWithReason: false
|
|
606
|
+
AllowedDirectives: []
|
|
591
607
|
|
|
592
608
|
# https://docs.rubocop.org/rubocop/cops_style.html#styledocumentdynamicevaldefinition
|
|
593
609
|
Style/DocumentDynamicEvalDefinition:
|
|
@@ -603,6 +619,7 @@ Style/Documentation:
|
|
|
603
619
|
Description: Document classes and non-namespace modules.
|
|
604
620
|
Enabled: true
|
|
605
621
|
VersionAdded: '0.9'
|
|
622
|
+
VersionChanged: '1.89'
|
|
606
623
|
AllowedConstants: []
|
|
607
624
|
Exclude:
|
|
608
625
|
- "spec/**/*"
|
|
@@ -619,13 +636,6 @@ Style/DocumentationMethod:
|
|
|
619
636
|
- "test/**/*"
|
|
620
637
|
RequireForNonPublicMethods: false
|
|
621
638
|
|
|
622
|
-
# Supports --autocorrect
|
|
623
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styledoublecopdisabledirective
|
|
624
|
-
Style/DoubleCopDisableDirective:
|
|
625
|
-
Description: Checks for double rubocop:disable comments on a single line.
|
|
626
|
-
Enabled: true
|
|
627
|
-
VersionAdded: '0.73'
|
|
628
|
-
|
|
629
639
|
# Supports --autocorrect
|
|
630
640
|
# https://docs.rubocop.org/rubocop/cops_style.html#styledoublenegation
|
|
631
641
|
Style/DoubleNegation:
|
|
@@ -670,6 +680,21 @@ Style/EmptyCaseCondition:
|
|
|
670
680
|
Enabled: true
|
|
671
681
|
VersionAdded: '0.40'
|
|
672
682
|
|
|
683
|
+
# Supports --autocorrect
|
|
684
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptyclassdefinition
|
|
685
|
+
Style/EmptyClassDefinition:
|
|
686
|
+
Description: Enforces consistent style for empty class definitions.
|
|
687
|
+
StyleGuide: "#single-line-classes"
|
|
688
|
+
Enabled: true # was pending
|
|
689
|
+
VersionAdded: '1.84'
|
|
690
|
+
VersionChanged: '1.86'
|
|
691
|
+
EnforcedStyle: class_keyword
|
|
692
|
+
SupportedStyles:
|
|
693
|
+
- class_keyword
|
|
694
|
+
- class_new
|
|
695
|
+
- class_definition
|
|
696
|
+
AllowedParentClasses: []
|
|
697
|
+
|
|
673
698
|
# Supports --autocorrect
|
|
674
699
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptyelse
|
|
675
700
|
Style/EmptyElse:
|
|
@@ -820,8 +845,7 @@ Style/ExplicitBlockArgument:
|
|
|
820
845
|
|
|
821
846
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleexponentialnotation
|
|
822
847
|
Style/ExponentialNotation:
|
|
823
|
-
Description:
|
|
824
|
-
and 10 (exclusive).
|
|
848
|
+
Description: Enforces consistency in the use of exponential (scientific) notation.
|
|
825
849
|
StyleGuide: "#exponential-notation"
|
|
826
850
|
Enabled: true
|
|
827
851
|
VersionAdded: '0.82'
|
|
@@ -839,7 +863,8 @@ Style/FetchEnvVar:
|
|
|
839
863
|
- https://rubystyle.guide/#hash-fetch-defaults
|
|
840
864
|
Enabled: true # was pending
|
|
841
865
|
VersionAdded: '1.28'
|
|
842
|
-
|
|
866
|
+
VersionChanged: '1.88'
|
|
867
|
+
AllowedVariables: []
|
|
843
868
|
DefaultToNil: true
|
|
844
869
|
|
|
845
870
|
# Supports --autocorrect
|
|
@@ -855,10 +880,19 @@ Style/FileEmpty:
|
|
|
855
880
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylefilenull
|
|
856
881
|
Style/FileNull:
|
|
857
882
|
Description: Use `File::NULL` instead of hardcoding "dev/null".
|
|
883
|
+
StyleGuide: "#null-devices"
|
|
858
884
|
Enabled: true # was pending
|
|
859
885
|
SafeAutoCorrect: false
|
|
860
886
|
VersionAdded: '1.69'
|
|
861
887
|
|
|
888
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylefileopen
|
|
889
|
+
Style/FileOpen:
|
|
890
|
+
Description: Checks for `File.open` without a block, which can leak file descriptors.
|
|
891
|
+
StyleGuide: "#auto-release-resources"
|
|
892
|
+
Enabled: true # was pending
|
|
893
|
+
Safe: false
|
|
894
|
+
VersionAdded: '1.85'
|
|
895
|
+
|
|
862
896
|
# Supports --autocorrect
|
|
863
897
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylefileread
|
|
864
898
|
Style/FileRead:
|
|
@@ -933,7 +967,10 @@ Style/FormatString:
|
|
|
933
967
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleformatstringtoken
|
|
934
968
|
Style/FormatStringToken:
|
|
935
969
|
Description: Use a consistent style for format string tokens.
|
|
970
|
+
StyleGuide: "#named-format-tokens"
|
|
936
971
|
Enabled: true
|
|
972
|
+
VersionAdded: '0.49'
|
|
973
|
+
VersionChanged: '1.74'
|
|
937
974
|
EnforcedStyle: annotated
|
|
938
975
|
SupportedStyles:
|
|
939
976
|
- annotated
|
|
@@ -941,8 +978,6 @@ Style/FormatStringToken:
|
|
|
941
978
|
- unannotated
|
|
942
979
|
MaxUnannotatedPlaceholdersAllowed: 1
|
|
943
980
|
Mode: aggressive
|
|
944
|
-
VersionAdded: '0.49'
|
|
945
|
-
VersionChanged: '1.74'
|
|
946
981
|
AllowedMethods: []
|
|
947
982
|
AllowedPatterns: []
|
|
948
983
|
|
|
@@ -1055,6 +1090,18 @@ Style/HashLikeCase:
|
|
|
1055
1090
|
VersionAdded: '0.88'
|
|
1056
1091
|
MinBranchesCount: 3
|
|
1057
1092
|
|
|
1093
|
+
# Supports --autocorrect
|
|
1094
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashlookupmethod
|
|
1095
|
+
Style/HashLookupMethod:
|
|
1096
|
+
Description: Enforces the use of either `Hash#[]` or `Hash#fetch` for hash lookup.
|
|
1097
|
+
Enabled: true # was false
|
|
1098
|
+
Safe: false
|
|
1099
|
+
VersionAdded: '1.84'
|
|
1100
|
+
EnforcedStyle: brackets
|
|
1101
|
+
SupportedStyles:
|
|
1102
|
+
- brackets
|
|
1103
|
+
- fetch
|
|
1104
|
+
|
|
1058
1105
|
# Supports --autocorrect
|
|
1059
1106
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashslice
|
|
1060
1107
|
Style/HashSlice:
|
|
@@ -1093,6 +1140,7 @@ Style/HashSyntax:
|
|
|
1093
1140
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashtransformkeys
|
|
1094
1141
|
Style/HashTransformKeys:
|
|
1095
1142
|
Description: Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.
|
|
1143
|
+
StyleGuide: "#hash-transform-methods"
|
|
1096
1144
|
Enabled: true
|
|
1097
1145
|
VersionAdded: '0.80'
|
|
1098
1146
|
VersionChanged: '0.90'
|
|
@@ -1102,6 +1150,7 @@ Style/HashTransformKeys:
|
|
|
1102
1150
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashtransformvalues
|
|
1103
1151
|
Style/HashTransformValues:
|
|
1104
1152
|
Description: Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.
|
|
1153
|
+
StyleGuide: "#hash-transform-methods"
|
|
1105
1154
|
Enabled: true
|
|
1106
1155
|
VersionAdded: '0.80'
|
|
1107
1156
|
VersionChanged: '0.90'
|
|
@@ -1122,9 +1171,9 @@ Style/IdenticalConditionalBranches:
|
|
|
1122
1171
|
Style/IfInsideElse:
|
|
1123
1172
|
Description: Finds if nodes inside else, which can be converted to elsif.
|
|
1124
1173
|
Enabled: true
|
|
1125
|
-
AllowIfModifier: false
|
|
1126
1174
|
VersionAdded: '0.36'
|
|
1127
1175
|
VersionChanged: '1.3'
|
|
1176
|
+
AllowIfModifier: false
|
|
1128
1177
|
|
|
1129
1178
|
# Supports --autocorrect
|
|
1130
1179
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleifunlessmodifier
|
|
@@ -1151,6 +1200,7 @@ Style/IfWithBooleanLiteralBranches:
|
|
|
1151
1200
|
VersionAdded: '1.9'
|
|
1152
1201
|
SafeAutoCorrect: false
|
|
1153
1202
|
AllowedMethods:
|
|
1203
|
+
- infinite?
|
|
1154
1204
|
- nonzero?
|
|
1155
1205
|
|
|
1156
1206
|
# Supports --autocorrect
|
|
@@ -1261,14 +1311,14 @@ Style/ItBlockParameter:
|
|
|
1261
1311
|
Description: Checks for blocks with one argument where `it` block parameter can be
|
|
1262
1312
|
used.
|
|
1263
1313
|
Enabled: true # was pending
|
|
1314
|
+
VersionAdded: '1.75'
|
|
1315
|
+
VersionChanged: '1.76'
|
|
1264
1316
|
EnforcedStyle: allow_single_line
|
|
1265
1317
|
SupportedStyles:
|
|
1266
1318
|
- allow_single_line
|
|
1267
1319
|
- only_numbered_parameters
|
|
1268
1320
|
- always
|
|
1269
1321
|
- disallow
|
|
1270
|
-
VersionAdded: '1.75'
|
|
1271
|
-
VersionChanged: '1.76'
|
|
1272
1322
|
|
|
1273
1323
|
# Supports --autocorrect
|
|
1274
1324
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylekeywordargumentsmerging
|
|
@@ -1284,7 +1334,7 @@ Style/KeywordArgumentsMerging:
|
|
|
1284
1334
|
Style/KeywordParametersOrder:
|
|
1285
1335
|
Description: Enforces that optional keyword parameters are placed at the end of the
|
|
1286
1336
|
parameters list.
|
|
1287
|
-
StyleGuide: "#keyword-
|
|
1337
|
+
StyleGuide: "#keyword-arguments-order"
|
|
1288
1338
|
Enabled: true
|
|
1289
1339
|
VersionAdded: '0.90'
|
|
1290
1340
|
VersionChanged: '1.7'
|
|
@@ -1321,6 +1371,7 @@ Style/LambdaCall:
|
|
|
1321
1371
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylelineendconcatenation
|
|
1322
1372
|
Style/LineEndConcatenation:
|
|
1323
1373
|
Description: Use \ instead of + or << to concatenate two string literals at line end.
|
|
1374
|
+
StyleGuide: "#heredoc-long-strings"
|
|
1324
1375
|
Enabled: true
|
|
1325
1376
|
SafeAutoCorrect: false
|
|
1326
1377
|
VersionAdded: '0.18'
|
|
@@ -1332,6 +1383,7 @@ Style/MagicCommentFormat:
|
|
|
1332
1383
|
Description: Use a consistent style for magic comments.
|
|
1333
1384
|
Enabled: true # was pending
|
|
1334
1385
|
VersionAdded: '1.35'
|
|
1386
|
+
VersionChanged: '1.91'
|
|
1335
1387
|
EnforcedStyle: snake_case
|
|
1336
1388
|
SupportedStyles:
|
|
1337
1389
|
- snake_case
|
|
@@ -1347,7 +1399,9 @@ Style/MagicCommentFormat:
|
|
|
1347
1399
|
Style/MapCompactWithConditionalBlock:
|
|
1348
1400
|
Description: Prefer `select` or `reject` over `map { ... }.compact`.
|
|
1349
1401
|
Enabled: true # was pending
|
|
1402
|
+
SafeAutoCorrect: false
|
|
1350
1403
|
VersionAdded: '1.30'
|
|
1404
|
+
VersionChanged: '1.88'
|
|
1351
1405
|
|
|
1352
1406
|
# Supports --autocorrect
|
|
1353
1407
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylemapintoarray
|
|
@@ -1360,6 +1414,14 @@ Style/MapIntoArray:
|
|
|
1360
1414
|
VersionChanged: '1.67'
|
|
1361
1415
|
Safe: false
|
|
1362
1416
|
|
|
1417
|
+
# Supports --autocorrect
|
|
1418
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylemapjoin
|
|
1419
|
+
Style/MapJoin:
|
|
1420
|
+
Description: Checks for redundant `map(&:to_s)` before `join`.
|
|
1421
|
+
Enabled: true # was pending
|
|
1422
|
+
Safe: false
|
|
1423
|
+
VersionAdded: '1.85'
|
|
1424
|
+
|
|
1363
1425
|
# Supports --autocorrect
|
|
1364
1426
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylemaptohash
|
|
1365
1427
|
Style/MapToHash:
|
|
@@ -1404,10 +1466,10 @@ Style/MethodCallWithoutArgsParentheses:
|
|
|
1404
1466
|
Description: Do not use parentheses for method calls with no arguments.
|
|
1405
1467
|
StyleGuide: "#method-invocation-parens"
|
|
1406
1468
|
Enabled: true
|
|
1407
|
-
AllowedMethods: []
|
|
1408
|
-
AllowedPatterns: []
|
|
1409
1469
|
VersionAdded: '0.47'
|
|
1410
1470
|
VersionChanged: '0.55'
|
|
1471
|
+
AllowedMethods: []
|
|
1472
|
+
AllowedPatterns: []
|
|
1411
1473
|
|
|
1412
1474
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylemethodcalledondoendblock
|
|
1413
1475
|
Style/MethodCalledOnDoEndBlock:
|
|
@@ -1468,6 +1530,7 @@ Style/MissingRespondToMissing:
|
|
|
1468
1530
|
StyleGuide: "#no-method-missing"
|
|
1469
1531
|
Enabled: true
|
|
1470
1532
|
VersionAdded: '0.56'
|
|
1533
|
+
VersionChanged: '1.89'
|
|
1471
1534
|
|
|
1472
1535
|
# Supports --autocorrect
|
|
1473
1536
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylemixingrouping
|
|
@@ -1522,7 +1585,7 @@ Style/MultilineBlockChain:
|
|
|
1522
1585
|
# Supports --autocorrect
|
|
1523
1586
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylemultilineifmodifier
|
|
1524
1587
|
Style/MultilineIfModifier:
|
|
1525
|
-
Description:
|
|
1588
|
+
Description: Checks for uses of `if`/`unless` modifiers with multiline bodies.
|
|
1526
1589
|
StyleGuide: "#no-multiline-if-modifiers"
|
|
1527
1590
|
Enabled: true
|
|
1528
1591
|
VersionAdded: '0.45'
|
|
@@ -1598,12 +1661,13 @@ Style/MutableConstant:
|
|
|
1598
1661
|
Description: Do not assign mutable objects to constants.
|
|
1599
1662
|
Enabled: true
|
|
1600
1663
|
VersionAdded: '0.34'
|
|
1601
|
-
VersionChanged: '1.
|
|
1664
|
+
VersionChanged: '1.88'
|
|
1602
1665
|
SafeAutoCorrect: false
|
|
1603
1666
|
EnforcedStyle: literals
|
|
1604
1667
|
SupportedStyles:
|
|
1605
1668
|
- literals
|
|
1606
1669
|
- strict
|
|
1670
|
+
Recursive: false
|
|
1607
1671
|
|
|
1608
1672
|
# Supports --autocorrect
|
|
1609
1673
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylenegatedif
|
|
@@ -1631,7 +1695,7 @@ Style/NegatedIfElseCondition:
|
|
|
1631
1695
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylenegatedunless
|
|
1632
1696
|
Style/NegatedUnless:
|
|
1633
1697
|
Description: Favor if over unless for negative conditions.
|
|
1634
|
-
StyleGuide: "#
|
|
1698
|
+
StyleGuide: "#unless-for-negatives"
|
|
1635
1699
|
Enabled: true
|
|
1636
1700
|
VersionAdded: '0.69'
|
|
1637
1701
|
EnforcedStyle: both
|
|
@@ -1648,6 +1712,17 @@ Style/NegatedWhile:
|
|
|
1648
1712
|
Enabled: true
|
|
1649
1713
|
VersionAdded: '0.20'
|
|
1650
1714
|
|
|
1715
|
+
# Supports --autocorrect
|
|
1716
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylenegativearrayindex
|
|
1717
|
+
Style/NegativeArrayIndex:
|
|
1718
|
+
Description: Use negative array indices instead of calculating array length minus
|
|
1719
|
+
a value. Also handles range patterns with length calculations. Recognizes preserving
|
|
1720
|
+
methods and their combinations, allowing safe replacement when the receiver matches.
|
|
1721
|
+
Enabled: true # was pending
|
|
1722
|
+
Safe: false
|
|
1723
|
+
VersionAdded: '1.84'
|
|
1724
|
+
VersionChanged: '1.92'
|
|
1725
|
+
|
|
1651
1726
|
# Supports --autocorrect
|
|
1652
1727
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylenestedfiledirname
|
|
1653
1728
|
Style/NestedFileDirname:
|
|
@@ -1826,6 +1901,18 @@ Style/ObjectThen:
|
|
|
1826
1901
|
- then
|
|
1827
1902
|
- yield_self
|
|
1828
1903
|
|
|
1904
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleoneclassperfile
|
|
1905
|
+
Style/OneClassPerFile:
|
|
1906
|
+
Description: Checks that each source file defines at most one top-level class or module.
|
|
1907
|
+
StyleGuide: "#one-class-per-file"
|
|
1908
|
+
Enabled: true # was pending
|
|
1909
|
+
VersionAdded: '1.85'
|
|
1910
|
+
VersionChanged: '1.86'
|
|
1911
|
+
AllowedClasses: []
|
|
1912
|
+
Exclude:
|
|
1913
|
+
- "spec/**/*"
|
|
1914
|
+
- "test/**/*"
|
|
1915
|
+
|
|
1829
1916
|
# Supports --autocorrect
|
|
1830
1917
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleonelineconditional
|
|
1831
1918
|
Style/OneLineConditional:
|
|
@@ -1833,9 +1920,9 @@ Style/OneLineConditional:
|
|
|
1833
1920
|
if/then/else/end constructs.
|
|
1834
1921
|
StyleGuide: "#ternary-operator"
|
|
1835
1922
|
Enabled: true
|
|
1836
|
-
AlwaysCorrectToMultiline: false
|
|
1837
1923
|
VersionAdded: '0.9'
|
|
1838
1924
|
VersionChanged: '0.90'
|
|
1925
|
+
AlwaysCorrectToMultiline: false
|
|
1839
1926
|
|
|
1840
1927
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleopenstructuse
|
|
1841
1928
|
Style/OpenStructUse:
|
|
@@ -1919,6 +2006,15 @@ Style/ParenthesesAroundCondition:
|
|
|
1919
2006
|
AllowSafeAssignment: true
|
|
1920
2007
|
AllowInMultilineConditions: false
|
|
1921
2008
|
|
|
2009
|
+
# Supports --autocorrect
|
|
2010
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylepartitioninsteadofdoubleselect
|
|
2011
|
+
Style/PartitionInsteadOfDoubleSelect:
|
|
2012
|
+
Description: Checks for consecutive `select`/`filter`/`find_all` and `reject` calls
|
|
2013
|
+
on the same receiver with the same block body.
|
|
2014
|
+
Enabled: true # was pending
|
|
2015
|
+
Safe: false
|
|
2016
|
+
VersionAdded: '1.85'
|
|
2017
|
+
|
|
1922
2018
|
# Supports --autocorrect
|
|
1923
2019
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylepercentliteraldelimiters
|
|
1924
2020
|
Style/PercentLiteralDelimiters:
|
|
@@ -1926,6 +2022,7 @@ Style/PercentLiteralDelimiters:
|
|
|
1926
2022
|
StyleGuide: "#percent-literal-braces"
|
|
1927
2023
|
Enabled: true
|
|
1928
2024
|
VersionAdded: '0.19'
|
|
2025
|
+
VersionChanged: '0.48'
|
|
1929
2026
|
PreferredDelimiters:
|
|
1930
2027
|
default: "()"
|
|
1931
2028
|
"%i": "[]"
|
|
@@ -1933,7 +2030,6 @@ Style/PercentLiteralDelimiters:
|
|
|
1933
2030
|
"%r": "{}"
|
|
1934
2031
|
"%w": "[]"
|
|
1935
2032
|
"%W": "[]"
|
|
1936
|
-
VersionChanged: '0.48'
|
|
1937
2033
|
|
|
1938
2034
|
# Supports --autocorrect
|
|
1939
2035
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylepercentqliterals
|
|
@@ -1954,6 +2050,14 @@ Style/PerlBackrefs:
|
|
|
1954
2050
|
Enabled: true
|
|
1955
2051
|
VersionAdded: '0.13'
|
|
1956
2052
|
|
|
2053
|
+
# Supports --autocorrect
|
|
2054
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylepredicatewithkind
|
|
2055
|
+
Style/PredicateWithKind:
|
|
2056
|
+
Description: Prefer `any?(Klass)` to `any? { |x| x.is_a?(Klass) }`.
|
|
2057
|
+
Enabled: true # was pending
|
|
2058
|
+
SafeAutoCorrect: false
|
|
2059
|
+
VersionAdded: '1.85'
|
|
2060
|
+
|
|
1957
2061
|
# Supports --autocorrect
|
|
1958
2062
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylepreferredhashmethods
|
|
1959
2063
|
Style/PreferredHashMethods:
|
|
@@ -2013,6 +2117,15 @@ Style/RandomWithOffset:
|
|
|
2013
2117
|
Enabled: true
|
|
2014
2118
|
VersionAdded: '0.52'
|
|
2015
2119
|
|
|
2120
|
+
# Supports --autocorrect
|
|
2121
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylereducetohash
|
|
2122
|
+
Style/ReduceToHash:
|
|
2123
|
+
Description: Use `to_h { ... }` instead of `each_with_object`, `inject`, or `reduce`
|
|
2124
|
+
to build a hash.
|
|
2125
|
+
Enabled: true # was pending
|
|
2126
|
+
Safe: false
|
|
2127
|
+
VersionAdded: '1.85'
|
|
2128
|
+
|
|
2016
2129
|
# Supports --autocorrect
|
|
2017
2130
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantargument
|
|
2018
2131
|
Style/RedundantArgument:
|
|
@@ -2077,6 +2190,7 @@ Style/RedundantCondition:
|
|
|
2077
2190
|
VersionAdded: '0.76'
|
|
2078
2191
|
VersionChanged: '1.73'
|
|
2079
2192
|
AllowedMethods:
|
|
2193
|
+
- infinite?
|
|
2080
2194
|
- nonzero?
|
|
2081
2195
|
|
|
2082
2196
|
# Supports --autocorrect
|
|
@@ -2090,6 +2204,7 @@ Style/RedundantConditional:
|
|
|
2090
2204
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantconstantbase
|
|
2091
2205
|
Style/RedundantConstantBase:
|
|
2092
2206
|
Description: Avoid redundant `::` prefix on constant.
|
|
2207
|
+
VersionChanged: '1.89'
|
|
2093
2208
|
Enabled: true # was pending
|
|
2094
2209
|
VersionAdded: '1.40'
|
|
2095
2210
|
|
|
@@ -2189,9 +2304,9 @@ Style/RedundantInitialize:
|
|
|
2189
2304
|
Enabled: true # was pending
|
|
2190
2305
|
AutoCorrect: contextual
|
|
2191
2306
|
Safe: false
|
|
2192
|
-
AllowComments: true
|
|
2193
2307
|
VersionAdded: '1.27'
|
|
2194
2308
|
VersionChanged: '1.61'
|
|
2309
|
+
AllowComments: true
|
|
2195
2310
|
|
|
2196
2311
|
# Supports --autocorrect
|
|
2197
2312
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantinterpolation
|
|
@@ -2213,9 +2328,17 @@ Style/RedundantInterpolationUnfreeze:
|
|
|
2213
2328
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantlinecontinuation
|
|
2214
2329
|
Style/RedundantLineContinuation:
|
|
2215
2330
|
Description: Checks for redundant line continuation.
|
|
2331
|
+
StyleGuide: "#no-trailing-backslash"
|
|
2216
2332
|
Enabled: true # was pending
|
|
2217
2333
|
VersionAdded: '1.49'
|
|
2218
2334
|
|
|
2335
|
+
# Supports --autocorrect
|
|
2336
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantminmaxby
|
|
2337
|
+
Style/RedundantMinMaxBy:
|
|
2338
|
+
Description: Identifies places where `max_by`/`min_by` can be replaced by `max`/`min`.
|
|
2339
|
+
Enabled: true # was pending
|
|
2340
|
+
VersionAdded: '1.85'
|
|
2341
|
+
|
|
2219
2342
|
# Supports --autocorrect
|
|
2220
2343
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantparentheses
|
|
2221
2344
|
Style/RedundantParentheses:
|
|
@@ -2258,6 +2381,7 @@ Style/RedundantRegexpConstructor:
|
|
|
2258
2381
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantregexpescape
|
|
2259
2382
|
Style/RedundantRegexpEscape:
|
|
2260
2383
|
Description: Checks for redundant escapes in Regexps.
|
|
2384
|
+
StyleGuide: "#limit-escapes"
|
|
2261
2385
|
Enabled: true
|
|
2262
2386
|
VersionAdded: '0.85'
|
|
2263
2387
|
|
|
@@ -2320,6 +2444,15 @@ Style/RedundantStringEscape:
|
|
|
2320
2444
|
Enabled: true # was pending
|
|
2321
2445
|
VersionAdded: '1.37'
|
|
2322
2446
|
|
|
2447
|
+
# Supports --autocorrect
|
|
2448
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantstructkeywordinit
|
|
2449
|
+
Style/RedundantStructKeywordInit:
|
|
2450
|
+
Description: Checks for redundant `keyword_init` option for `Struct.new`.
|
|
2451
|
+
Enabled: true # was false
|
|
2452
|
+
SafeAutoCorrect: false
|
|
2453
|
+
VersionAdded: '1.85'
|
|
2454
|
+
VersionChanged: '1.86'
|
|
2455
|
+
|
|
2323
2456
|
# Supports --autocorrect
|
|
2324
2457
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleregexpliteral
|
|
2325
2458
|
Style/RegexpLiteral:
|
|
@@ -2381,10 +2514,18 @@ Style/ReturnNilInPredicateMethodDefinition:
|
|
|
2381
2514
|
StyleGuide: "#bool-methods-qmark"
|
|
2382
2515
|
Enabled: true # was pending
|
|
2383
2516
|
SafeAutoCorrect: false
|
|
2384
|
-
AllowedMethods: []
|
|
2385
|
-
AllowedPatterns: []
|
|
2386
2517
|
VersionAdded: '1.53'
|
|
2387
2518
|
VersionChanged: '1.67'
|
|
2519
|
+
AllowedMethods: []
|
|
2520
|
+
AllowedPatterns: []
|
|
2521
|
+
|
|
2522
|
+
# Supports --autocorrect
|
|
2523
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#stylereversefind
|
|
2524
|
+
Style/ReverseFind:
|
|
2525
|
+
Description: Use `array.rfind` instead of `array.reverse.find`.
|
|
2526
|
+
Enabled: true # was pending
|
|
2527
|
+
Safe: false
|
|
2528
|
+
VersionAdded: '1.84'
|
|
2388
2529
|
|
|
2389
2530
|
# Supports --autocorrect
|
|
2390
2531
|
# https://docs.rubocop.org/rubocop/cops_style.html#stylesafenavigation
|
|
@@ -2422,10 +2563,26 @@ Style/Sample:
|
|
|
2422
2563
|
Enabled: true
|
|
2423
2564
|
VersionAdded: '0.30'
|
|
2424
2565
|
|
|
2566
|
+
# Supports --autocorrect
|
|
2567
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleselectbykind
|
|
2568
|
+
Style/SelectByKind:
|
|
2569
|
+
Description: Prefer grep/grep_v to select/reject/find/detect with a kind check.
|
|
2570
|
+
Enabled: true # was pending
|
|
2571
|
+
SafeAutoCorrect: false
|
|
2572
|
+
VersionAdded: '1.85'
|
|
2573
|
+
|
|
2574
|
+
# Supports --autocorrect
|
|
2575
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styleselectbyrange
|
|
2576
|
+
Style/SelectByRange:
|
|
2577
|
+
Description: Prefer grep/grep_v to select/reject/find/detect with a range check.
|
|
2578
|
+
Enabled: true # was pending
|
|
2579
|
+
SafeAutoCorrect: false
|
|
2580
|
+
VersionAdded: '1.85'
|
|
2581
|
+
|
|
2425
2582
|
# Supports --autocorrect
|
|
2426
2583
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleselectbyregexp
|
|
2427
2584
|
Style/SelectByRegexp:
|
|
2428
|
-
Description: Prefer grep/grep_v to select/reject with a regexp match.
|
|
2585
|
+
Description: Prefer grep/grep_v to select/reject/find/detect with a regexp match.
|
|
2429
2586
|
Enabled: true # was pending
|
|
2430
2587
|
SafeAutoCorrect: false
|
|
2431
2588
|
VersionAdded: '1.22'
|
|
@@ -2575,6 +2732,7 @@ Style/StabbyLambdaParentheses:
|
|
|
2575
2732
|
Style/StaticClass:
|
|
2576
2733
|
Description: Prefer modules to classes with only class methods.
|
|
2577
2734
|
StyleGuide: "#modules-vs-classes"
|
|
2735
|
+
VersionChanged: '1.89'
|
|
2578
2736
|
Enabled: true # was false
|
|
2579
2737
|
Safe: false
|
|
2580
2738
|
VersionAdded: '1.3'
|
|
@@ -2732,6 +2890,14 @@ Style/SymbolProc:
|
|
|
2732
2890
|
AllowedPatterns: []
|
|
2733
2891
|
AllowComments: false
|
|
2734
2892
|
|
|
2893
|
+
# Supports --autocorrect
|
|
2894
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletallymethod
|
|
2895
|
+
Style/TallyMethod:
|
|
2896
|
+
Description: Prefer `Enumerable#tally` over manual counting patterns.
|
|
2897
|
+
Enabled: true # was pending
|
|
2898
|
+
Safe: false
|
|
2899
|
+
VersionAdded: '1.85'
|
|
2900
|
+
|
|
2735
2901
|
# Supports --autocorrect
|
|
2736
2902
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleternaryparentheses
|
|
2737
2903
|
Style/TernaryParentheses:
|
|
@@ -2746,6 +2912,15 @@ Style/TernaryParentheses:
|
|
|
2746
2912
|
- require_parentheses_when_complex
|
|
2747
2913
|
AllowSafeAssignment: true
|
|
2748
2914
|
|
|
2915
|
+
# Supports --autocorrect
|
|
2916
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styletimenow
|
|
2917
|
+
Style/TimeNow:
|
|
2918
|
+
Description: Prefer `Time.now` over `Time.new` when retrieving the current system
|
|
2919
|
+
time.
|
|
2920
|
+
StyleGuide: "#time-now"
|
|
2921
|
+
Enabled: true # was pending
|
|
2922
|
+
VersionAdded: '1.90'
|
|
2923
|
+
|
|
2749
2924
|
# https://docs.rubocop.org/rubocop/cops_style.html#styletoplevelmethoddefinition
|
|
2750
2925
|
Style/TopLevelMethodDefinition:
|
|
2751
2926
|
Description: Looks for top-level method definitions.
|
|
@@ -2763,14 +2938,14 @@ Style/TrailingBodyOnClass:
|
|
|
2763
2938
|
# Supports --autocorrect
|
|
2764
2939
|
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingbodyonmethoddefinition
|
|
2765
2940
|
Style/TrailingBodyOnMethodDefinition:
|
|
2766
|
-
Description:
|
|
2941
|
+
Description: Checks for trailing code after the method definition.
|
|
2767
2942
|
Enabled: true
|
|
2768
2943
|
VersionAdded: '0.52'
|
|
2769
2944
|
|
|
2770
2945
|
# Supports --autocorrect
|
|
2771
2946
|
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingbodyonmodule
|
|
2772
2947
|
Style/TrailingBodyOnModule:
|
|
2773
|
-
Description:
|
|
2948
|
+
Description: Checks for trailing code after the module definition.
|
|
2774
2949
|
Enabled: true
|
|
2775
2950
|
VersionAdded: '0.53'
|
|
2776
2951
|
|
|
@@ -2835,10 +3010,11 @@ Style/TrailingMethodEndStatement:
|
|
|
2835
3010
|
Style/TrailingUnderscoreVariable:
|
|
2836
3011
|
Description: Checks for the usage of unneeded trailing underscores at the end of parallel
|
|
2837
3012
|
variable assignment.
|
|
2838
|
-
|
|
3013
|
+
StyleGuide: "#trailing-underscore-variables"
|
|
2839
3014
|
Enabled: true
|
|
2840
3015
|
VersionAdded: '0.31'
|
|
2841
3016
|
VersionChanged: '0.35'
|
|
3017
|
+
AllowNamedUnderscoreVariables: true
|
|
2842
3018
|
|
|
2843
3019
|
# Supports --autocorrect
|
|
2844
3020
|
# https://docs.rubocop.org/rubocop/cops_style.html#styletrivialaccessors
|
|
@@ -2961,15 +3137,15 @@ Style/YodaCondition:
|
|
|
2961
3137
|
References:
|
|
2962
3138
|
- https://en.wikipedia.org/wiki/Yoda_conditions
|
|
2963
3139
|
Enabled: true
|
|
3140
|
+
Safe: false
|
|
3141
|
+
VersionAdded: '0.49'
|
|
3142
|
+
VersionChanged: '0.75'
|
|
2964
3143
|
EnforcedStyle: forbid_for_all_comparison_operators
|
|
2965
3144
|
SupportedStyles:
|
|
2966
3145
|
- forbid_for_all_comparison_operators
|
|
2967
3146
|
- forbid_for_equality_operators_only
|
|
2968
3147
|
- require_for_all_comparison_operators
|
|
2969
3148
|
- require_for_equality_operators_only
|
|
2970
|
-
Safe: false
|
|
2971
|
-
VersionAdded: '0.49'
|
|
2972
|
-
VersionChanged: '0.75'
|
|
2973
3149
|
|
|
2974
3150
|
# Supports --autocorrect
|
|
2975
3151
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleyodaexpression
|