rubocop 1.14.0 → 1.18.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/README.md +3 -1
- data/config/default.yml +120 -34
- data/lib/rubocop.rb +8 -0
- data/lib/rubocop/cli/command/suggest_extensions.rb +3 -3
- data/lib/rubocop/config_loader.rb +1 -1
- data/lib/rubocop/config_validator.rb +5 -5
- data/lib/rubocop/cop/base.rb +2 -2
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +1 -1
- data/lib/rubocop/cop/bundler/gem_version.rb +38 -4
- data/lib/rubocop/cop/corrector.rb +4 -4
- data/lib/rubocop/cop/generator.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/example_description.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +1 -1
- data/lib/rubocop/cop/layout/argument_alignment.rb +30 -12
- data/lib/rubocop/cop/layout/array_alignment.rb +2 -2
- data/lib/rubocop/cop/layout/block_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/case_indentation.rb +57 -9
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +7 -1
- data/lib/rubocop/cop/layout/comment_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/dot_position.rb +7 -1
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +13 -15
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +14 -2
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/hash_alignment.rb +40 -14
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +1 -1
- data/lib/rubocop/cop/layout/indentation_width.rb +13 -2
- data/lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +122 -0
- data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +2 -2
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +3 -3
- data/lib/rubocop/cop/layout/parameter_alignment.rb +2 -2
- data/lib/rubocop/cop/layout/redundant_line_break.rb +11 -9
- data/lib/rubocop/cop/layout/space_around_keyword.rb +28 -0
- data/lib/rubocop/cop/layout/space_around_operators.rb +7 -1
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +4 -0
- data/lib/rubocop/cop/lint/empty_block.rb +18 -2
- data/lib/rubocop/cop/lint/empty_in_pattern.rb +62 -0
- data/lib/rubocop/cop/lint/literal_as_condition.rb +13 -1
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +32 -17
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +1 -1
- data/lib/rubocop/cop/lint/percent_string_array.rb +1 -1
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +1 -1
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +105 -74
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +5 -0
- data/lib/rubocop/cop/lint/symbol_conversion.rb +3 -13
- data/lib/rubocop/cop/lint/unused_block_argument.rb +1 -1
- data/lib/rubocop/cop/lint/useless_assignment.rb +1 -1
- data/lib/rubocop/cop/lint/void.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
- data/lib/rubocop/cop/migration/department_name.rb +3 -1
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +28 -3
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +6 -0
- data/lib/rubocop/cop/mixin/hash_alignment_styles.rb +14 -3
- data/lib/rubocop/cop/mixin/string_literals_help.rb +2 -4
- data/lib/rubocop/cop/mixin/symbol_help.rb +13 -0
- data/lib/rubocop/cop/naming/inclusive_language.rb +249 -0
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +2 -2
- data/lib/rubocop/cop/style/class_and_module_children.rb +28 -2
- data/lib/rubocop/cop/style/empty_literal.rb +8 -1
- data/lib/rubocop/cop/style/hash_each_methods.rb +18 -1
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +58 -8
- data/lib/rubocop/cop/style/in_pattern_then.rb +56 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +2 -1
- data/lib/rubocop/cop/style/multiline_in_pattern_then.rb +62 -0
- data/lib/rubocop/cop/style/multiline_when_then.rb +2 -11
- data/lib/rubocop/cop/style/multiple_comparison.rb +1 -1
- data/lib/rubocop/cop/style/nil_lambda.rb +29 -12
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/style/quoted_symbols.rb +110 -0
- data/lib/rubocop/cop/style/raise_args.rb +2 -0
- data/lib/rubocop/cop/style/redundant_begin.rb +1 -1
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +1 -1
- data/lib/rubocop/cop/style/redundant_self.rb +24 -2
- data/lib/rubocop/cop/style/regexp_literal.rb +10 -1
- data/lib/rubocop/cop/style/special_global_vars.rb +3 -3
- data/lib/rubocop/cop/style/string_concatenation.rb +32 -5
- data/lib/rubocop/cop/style/string_literals.rb +3 -2
- data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +1 -0
- data/lib/rubocop/cop/style/swap_values.rb +1 -1
- data/lib/rubocop/cop/style/top_level_method_definition.rb +83 -0
- data/lib/rubocop/cop/style/trivial_accessors.rb +65 -0
- data/lib/rubocop/cop/style/unpack_first.rb +1 -1
- data/lib/rubocop/cop/style/when_then.rb +6 -2
- data/lib/rubocop/cop/variable_force/variable_table.rb +1 -1
- data/lib/rubocop/directive_comment.rb +58 -6
- data/lib/rubocop/formatter/junit_formatter.rb +21 -6
- data/lib/rubocop/options.rb +18 -24
- data/lib/rubocop/rake_task.rb +1 -1
- data/lib/rubocop/remote_config.rb +10 -2
- data/lib/rubocop/rspec/cop_helper.rb +1 -1
- data/lib/rubocop/rspec/expect_offense.rb +1 -1
- data/lib/rubocop/version.rb +1 -1
- metadata +13 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da981ff0ada31e8ea4e414bf7d7d767fde269a06ad5b0cd61e71a36a16068263
|
4
|
+
data.tar.gz: 3b48f1b0f024c3202f5513a05a210707af81caa0b6d0bf2ba5ac4adad69f6b6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab683eefa5181d9dd814b18fc8a4949940a8623014ee12ded5e89ded4ea32162735275bbe4e27e2b025dc4cfe22d77072129bdc12be3d36ceda0ce232de6d6a8
|
7
|
+
data.tar.gz: 9058879a763a810107ce870cdb1eb1269e3bfdd432154d8c9ee19472f6dd69d3624ecaf97d520090ea7f80953f9a68c1da6455484738f28a6cb2ee59cd9c47dd
|
data/README.md
CHANGED
@@ -29,6 +29,8 @@ RuboCop is extremely flexible and most aspects of its behavior can be tweaked vi
|
|
29
29
|
[](#open-collective-sponsors)
|
30
30
|
[](https://tidelift.com/subscription/pkg/rubygems-rubocop?utm_source=rubygems-rubocop&utm_medium=referral&utm_campaign=readme)
|
31
31
|
|
32
|
+
Working on RuboCop is often fun, but it also requires a great deal of time and energy.
|
33
|
+
|
32
34
|
**Please consider [financially supporting its ongoing development](#funding).**
|
33
35
|
|
34
36
|
## Installation
|
@@ -52,7 +54,7 @@ To prevent an unwanted RuboCop update you might want to use a conservative versi
|
|
52
54
|
in your `Gemfile`:
|
53
55
|
|
54
56
|
```rb
|
55
|
-
gem 'rubocop', '~> 1.
|
57
|
+
gem 'rubocop', '~> 1.18', require: false
|
56
58
|
```
|
57
59
|
|
58
60
|
See [our versioning policy](https://docs.rubocop.org/rubocop/versioning.html) for further details.
|
data/config/default.yml
CHANGED
@@ -270,8 +270,8 @@ Layout/AccessModifierIndentation:
|
|
270
270
|
SupportedStyles:
|
271
271
|
- outdent
|
272
272
|
- indent
|
273
|
-
# By default
|
274
|
-
#
|
273
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
274
|
+
# but it can be overridden by setting this parameter.
|
275
275
|
IndentationWidth: ~
|
276
276
|
|
277
277
|
Layout/ArgumentAlignment:
|
@@ -299,8 +299,8 @@ Layout/ArgumentAlignment:
|
|
299
299
|
SupportedStyles:
|
300
300
|
- with_first_argument
|
301
301
|
- with_fixed_indentation
|
302
|
-
# By default
|
303
|
-
#
|
302
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
303
|
+
# but it can be overridden by setting this parameter.
|
304
304
|
IndentationWidth: ~
|
305
305
|
|
306
306
|
Layout/ArrayAlignment:
|
@@ -328,8 +328,8 @@ Layout/ArrayAlignment:
|
|
328
328
|
SupportedStyles:
|
329
329
|
- with_first_element
|
330
330
|
- with_fixed_indentation
|
331
|
-
# By default
|
332
|
-
#
|
331
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
332
|
+
# but it can be overridden by setting this parameter.
|
333
333
|
IndentationWidth: ~
|
334
334
|
|
335
335
|
Layout/AssignmentIndentation:
|
@@ -339,8 +339,8 @@ Layout/AssignmentIndentation:
|
|
339
339
|
Enabled: true
|
340
340
|
VersionAdded: '0.49'
|
341
341
|
VersionChanged: '0.77'
|
342
|
-
# By default
|
343
|
-
#
|
342
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
343
|
+
# but it can be overridden by setting this parameter.
|
344
344
|
IndentationWidth: ~
|
345
345
|
|
346
346
|
Layout/BeginEndAlignment:
|
@@ -377,18 +377,19 @@ Layout/BlockEndNewline:
|
|
377
377
|
VersionAdded: '0.49'
|
378
378
|
|
379
379
|
Layout/CaseIndentation:
|
380
|
-
Description: 'Indentation of when in a case/when/[else/]end.'
|
380
|
+
Description: 'Indentation of when in a case/(when|in)/[else/]end.'
|
381
381
|
StyleGuide: '#indent-when-to-case'
|
382
382
|
Enabled: true
|
383
383
|
VersionAdded: '0.49'
|
384
|
+
VersionChanged: '1.16'
|
384
385
|
EnforcedStyle: case
|
385
386
|
SupportedStyles:
|
386
387
|
- case
|
387
388
|
- end
|
388
389
|
IndentOneStep: false
|
389
|
-
# By default
|
390
|
-
#
|
391
|
-
# This only matters if `IndentOneStep` is `true
|
390
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
391
|
+
# but it can be overridden by setting this parameter.
|
392
|
+
# This only matters if `IndentOneStep` is `true`.
|
392
393
|
IndentationWidth: ~
|
393
394
|
|
394
395
|
Layout/ClassStructure:
|
@@ -665,8 +666,8 @@ Layout/FirstArgumentIndentation:
|
|
665
666
|
# Same as `special_for_inner_method_call` except that the special rule only
|
666
667
|
# applies if the outer method call encloses its arguments in parentheses.
|
667
668
|
- special_for_inner_method_call_in_parentheses
|
668
|
-
# By default
|
669
|
-
#
|
669
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
670
|
+
# but it can be overridden by setting this parameter.
|
670
671
|
IndentationWidth: ~
|
671
672
|
|
672
673
|
Layout/FirstArrayElementIndentation:
|
@@ -692,8 +693,8 @@ Layout/FirstArrayElementIndentation:
|
|
692
693
|
- special_inside_parentheses
|
693
694
|
- consistent
|
694
695
|
- align_brackets
|
695
|
-
# By default
|
696
|
-
#
|
696
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
697
|
+
# but it can be overridden by setting this parameter.
|
697
698
|
IndentationWidth: ~
|
698
699
|
|
699
700
|
Layout/FirstArrayElementLineBreak:
|
@@ -724,8 +725,8 @@ Layout/FirstHashElementIndentation:
|
|
724
725
|
- special_inside_parentheses
|
725
726
|
- consistent
|
726
727
|
- align_braces
|
727
|
-
# By default
|
728
|
-
#
|
728
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
729
|
+
# but it can be overridden by setting this parameter.
|
729
730
|
IndentationWidth: ~
|
730
731
|
|
731
732
|
Layout/FirstHashElementLineBreak:
|
@@ -760,8 +761,8 @@ Layout/FirstParameterIndentation:
|
|
760
761
|
SupportedStyles:
|
761
762
|
- consistent
|
762
763
|
- align_parentheses
|
763
|
-
# By default
|
764
|
-
#
|
764
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
765
|
+
# but it can be overridden by setting this parameter.
|
765
766
|
IndentationWidth: ~
|
766
767
|
|
767
768
|
Layout/HashAlignment:
|
@@ -771,7 +772,7 @@ Layout/HashAlignment:
|
|
771
772
|
Enabled: true
|
772
773
|
AllowMultipleStyles: true
|
773
774
|
VersionAdded: '0.49'
|
774
|
-
VersionChanged: '
|
775
|
+
VersionChanged: '1.16'
|
775
776
|
# Alignment of entries using hash rocket as separator. Valid values are:
|
776
777
|
#
|
777
778
|
# key - left alignment of keys
|
@@ -882,8 +883,8 @@ Layout/IndentationStyle:
|
|
882
883
|
Enabled: true
|
883
884
|
VersionAdded: '0.49'
|
884
885
|
VersionChanged: '0.82'
|
885
|
-
# By default
|
886
|
-
#
|
886
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
887
|
+
# but it can be overridden by setting this parameter.
|
887
888
|
# It is used during auto-correction to determine how many spaces should
|
888
889
|
# replace each tab.
|
889
890
|
IndentationWidth: ~
|
@@ -922,6 +923,20 @@ Layout/LeadingEmptyLines:
|
|
922
923
|
VersionAdded: '0.57'
|
923
924
|
VersionChanged: '0.77'
|
924
925
|
|
926
|
+
Layout/LineEndStringConcatenationIndentation:
|
927
|
+
Description: >-
|
928
|
+
Checks the indentation of the next line after a line that
|
929
|
+
ends with a string literal and a backslash.
|
930
|
+
Enabled: pending
|
931
|
+
VersionAdded: '1.18'
|
932
|
+
EnforcedStyle: aligned
|
933
|
+
SupportedStyles:
|
934
|
+
- aligned
|
935
|
+
- indented
|
936
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
937
|
+
# but it can be overridden by setting this parameter.
|
938
|
+
IndentationWidth: ~
|
939
|
+
|
925
940
|
Layout/LineLength:
|
926
941
|
Description: 'Checks that line length does not exceed the configured limit.'
|
927
942
|
StyleGuide: '#max-line-length'
|
@@ -1052,8 +1067,8 @@ Layout/MultilineMethodCallIndentation:
|
|
1052
1067
|
- aligned
|
1053
1068
|
- indented
|
1054
1069
|
- indented_relative_to_receiver
|
1055
|
-
# By default
|
1056
|
-
#
|
1070
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1071
|
+
# but it can be overridden by setting this parameter.
|
1057
1072
|
IndentationWidth: ~
|
1058
1073
|
|
1059
1074
|
Layout/MultilineMethodDefinitionBraceLayout:
|
@@ -1082,8 +1097,8 @@ Layout/MultilineOperationIndentation:
|
|
1082
1097
|
SupportedStyles:
|
1083
1098
|
- aligned
|
1084
1099
|
- indented
|
1085
|
-
# By default
|
1086
|
-
#
|
1100
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1101
|
+
# but it can be overridden by setting this parameter.
|
1087
1102
|
IndentationWidth: ~
|
1088
1103
|
|
1089
1104
|
Layout/ParameterAlignment:
|
@@ -1111,8 +1126,8 @@ Layout/ParameterAlignment:
|
|
1111
1126
|
SupportedStyles:
|
1112
1127
|
- with_first_parameter
|
1113
1128
|
- with_fixed_indentation
|
1114
|
-
# By default
|
1115
|
-
#
|
1129
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1130
|
+
# but it can be overridden by setting this parameter.
|
1116
1131
|
IndentationWidth: ~
|
1117
1132
|
|
1118
1133
|
Layout/RedundantLineBreak:
|
@@ -1612,7 +1627,7 @@ Lint/EmptyBlock:
|
|
1612
1627
|
Description: 'This cop checks for blocks without a body.'
|
1613
1628
|
Enabled: pending
|
1614
1629
|
VersionAdded: '1.1'
|
1615
|
-
VersionChanged: '1.
|
1630
|
+
VersionChanged: '1.15'
|
1616
1631
|
AllowComments: true
|
1617
1632
|
AllowEmptyLambdas: true
|
1618
1633
|
|
@@ -1645,6 +1660,12 @@ Lint/EmptyFile:
|
|
1645
1660
|
AllowComments: true
|
1646
1661
|
VersionAdded: '0.90'
|
1647
1662
|
|
1663
|
+
Lint/EmptyInPattern:
|
1664
|
+
Description: 'Checks for the presence of `in` pattern branches without a body.'
|
1665
|
+
Enabled: pending
|
1666
|
+
AllowComments: true
|
1667
|
+
VersionAdded: '1.16'
|
1668
|
+
|
1648
1669
|
Lint/EmptyInterpolation:
|
1649
1670
|
Description: 'Checks for empty string interpolation.'
|
1650
1671
|
Enabled: true
|
@@ -2092,6 +2113,7 @@ Lint/SymbolConversion:
|
|
2092
2113
|
Description: 'Checks for unnecessary symbol conversions.'
|
2093
2114
|
Enabled: pending
|
2094
2115
|
VersionAdded: '1.9'
|
2116
|
+
VersionChanged: '1.16'
|
2095
2117
|
EnforcedStyle: strict
|
2096
2118
|
SupportedStyles:
|
2097
2119
|
- strict
|
@@ -2512,6 +2534,36 @@ Naming/HeredocDelimiterNaming:
|
|
2512
2534
|
ForbiddenDelimiters:
|
2513
2535
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
2514
2536
|
|
2537
|
+
Naming/InclusiveLanguage:
|
2538
|
+
Description: 'Recommend the use of inclusive language instead of problematic terms.'
|
2539
|
+
Enabled: pending
|
2540
|
+
VersionAdded: '1.18'
|
2541
|
+
CheckIdentifiers: true
|
2542
|
+
CheckConstants: true
|
2543
|
+
CheckVariables: true
|
2544
|
+
CheckStrings: true
|
2545
|
+
CheckSymbols: true
|
2546
|
+
CheckComments: true
|
2547
|
+
CheckFilepaths: true
|
2548
|
+
FlaggedTerms:
|
2549
|
+
whitelist:
|
2550
|
+
Regex: !ruby/regexp '/white[-_\s]?list/'
|
2551
|
+
Suggestions:
|
2552
|
+
- allowlist
|
2553
|
+
- permit
|
2554
|
+
blacklist:
|
2555
|
+
Regex: !ruby/regexp '/black[-_\s]?list/'
|
2556
|
+
Suggestions:
|
2557
|
+
- denylist
|
2558
|
+
- block
|
2559
|
+
master:
|
2560
|
+
Suggestions: ['main', 'primary', 'leader']
|
2561
|
+
AllowedRegex:
|
2562
|
+
- 'Master of None'
|
2563
|
+
- 'Master Boot Record'
|
2564
|
+
slave:
|
2565
|
+
Suggestions: ['replica', 'secondary', 'follower']
|
2566
|
+
|
2515
2567
|
Naming/MemoizedInstanceVariableName:
|
2516
2568
|
Description: >-
|
2517
2569
|
Memoized method name should match memo instance variable name.
|
@@ -3480,6 +3532,7 @@ Style/HashAsLastArrayItem:
|
|
3480
3532
|
|
3481
3533
|
Style/HashConversion:
|
3482
3534
|
Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
|
3535
|
+
StyleGuide: '#avoid-hash-constructor'
|
3483
3536
|
Enabled: pending
|
3484
3537
|
VersionAdded: '1.10'
|
3485
3538
|
VersionChanged: '1.11'
|
@@ -3489,8 +3542,10 @@ Style/HashEachMethods:
|
|
3489
3542
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
3490
3543
|
StyleGuide: '#hash-each'
|
3491
3544
|
Enabled: true
|
3492
|
-
VersionAdded: '0.80'
|
3493
3545
|
Safe: false
|
3546
|
+
VersionAdded: '0.80'
|
3547
|
+
VersionChanged: '1.16'
|
3548
|
+
AllowedReceivers: []
|
3494
3549
|
|
3495
3550
|
Style/HashExcept:
|
3496
3551
|
Description: >-
|
@@ -3553,6 +3608,7 @@ Style/IdenticalConditionalBranches:
|
|
3553
3608
|
out of the conditional.
|
3554
3609
|
Enabled: true
|
3555
3610
|
VersionAdded: '0.36'
|
3611
|
+
VersionChanged: '1.16'
|
3556
3612
|
|
3557
3613
|
Style/IfInsideElse:
|
3558
3614
|
Description: 'Finds if nodes inside else, which can be converted to elsif.'
|
@@ -3599,6 +3655,12 @@ Style/ImplicitRuntimeError:
|
|
3599
3655
|
Enabled: false
|
3600
3656
|
VersionAdded: '0.41'
|
3601
3657
|
|
3658
|
+
Style/InPatternThen:
|
3659
|
+
Description: 'Checks for `in;` uses in `case` expressions.'
|
3660
|
+
StyleGuide: '#no-in-pattern-semicolons'
|
3661
|
+
Enabled: pending
|
3662
|
+
VersionAdded: '1.16'
|
3663
|
+
|
3602
3664
|
Style/InfiniteLoop:
|
3603
3665
|
Description: >-
|
3604
3666
|
Use Kernel#loop for infinite loops.
|
@@ -3827,6 +3889,12 @@ Style/MultilineIfThen:
|
|
3827
3889
|
VersionAdded: '0.9'
|
3828
3890
|
VersionChanged: '0.26'
|
3829
3891
|
|
3892
|
+
Style/MultilineInPatternThen:
|
3893
|
+
Description: 'Do not use `then` for multi-line `in` statement.'
|
3894
|
+
StyleGuide: '#no-then'
|
3895
|
+
Enabled: pending
|
3896
|
+
VersionAdded: '1.16'
|
3897
|
+
|
3830
3898
|
Style/MultilineMemoization:
|
3831
3899
|
Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
|
3832
3900
|
Enabled: true
|
@@ -3998,6 +4066,7 @@ Style/NilLambda:
|
|
3998
4066
|
Description: 'Prefer `-> {}` to `-> { nil }`.'
|
3999
4067
|
Enabled: pending
|
4000
4068
|
VersionAdded: '1.3'
|
4069
|
+
VersionChanged: '1.15'
|
4001
4070
|
|
4002
4071
|
Style/NonNilCheck:
|
4003
4072
|
Description: 'Checks for redundant nil checks.'
|
@@ -4184,6 +4253,16 @@ Style/Proc:
|
|
4184
4253
|
VersionAdded: '0.9'
|
4185
4254
|
VersionChanged: '0.18'
|
4186
4255
|
|
4256
|
+
Style/QuotedSymbols:
|
4257
|
+
Description: 'Use a consistent style for quoted symbols.'
|
4258
|
+
Enabled: pending
|
4259
|
+
VersionAdded: '1.16'
|
4260
|
+
EnforcedStyle: same_as_string_literals
|
4261
|
+
SupportedStyles:
|
4262
|
+
- same_as_string_literals
|
4263
|
+
- single_quotes
|
4264
|
+
- double_quotes
|
4265
|
+
|
4187
4266
|
Style/RaiseArgs:
|
4188
4267
|
Description: 'Checks the arguments passed to raise/fail.'
|
4189
4268
|
StyleGuide: '#exception-class-messages'
|
@@ -4541,7 +4620,8 @@ Style/StringConcatenation:
|
|
4541
4620
|
Enabled: true
|
4542
4621
|
Safe: false
|
4543
4622
|
VersionAdded: '0.89'
|
4544
|
-
VersionChanged: '1.
|
4623
|
+
VersionChanged: '1.18'
|
4624
|
+
Mode: aggressive
|
4545
4625
|
|
4546
4626
|
Style/StringHashKeys:
|
4547
4627
|
Description: 'Prefer symbols instead of strings as hash keys.'
|
@@ -4651,6 +4731,12 @@ Style/TernaryParentheses:
|
|
4651
4731
|
- require_parentheses_when_complex
|
4652
4732
|
AllowSafeAssignment: true
|
4653
4733
|
|
4734
|
+
Style/TopLevelMethodDefinition:
|
4735
|
+
Description: 'This cop looks for top-level method definitions.'
|
4736
|
+
StyleGuide: '#top-level-methods'
|
4737
|
+
Enabled: false
|
4738
|
+
VersionAdded: '1.15'
|
4739
|
+
|
4654
4740
|
Style/TrailingBodyOnClass:
|
4655
4741
|
Description: 'Class body goes below class statement.'
|
4656
4742
|
Enabled: true
|
@@ -4737,7 +4823,7 @@ Style/TrivialAccessors:
|
|
4737
4823
|
StyleGuide: '#attr_family'
|
4738
4824
|
Enabled: true
|
4739
4825
|
VersionAdded: '0.9'
|
4740
|
-
VersionChanged: '
|
4826
|
+
VersionChanged: '1.15'
|
4741
4827
|
# When set to `false` the cop will suggest the use of accessor methods
|
4742
4828
|
# in situations like:
|
4743
4829
|
#
|
@@ -4756,7 +4842,7 @@ Style/TrivialAccessors:
|
|
4756
4842
|
# on_exception :restart
|
4757
4843
|
#
|
4758
4844
|
# Commonly used in DSLs
|
4759
|
-
AllowDSLWriters:
|
4845
|
+
AllowDSLWriters: true
|
4760
4846
|
IgnoreClassMethods: false
|
4761
4847
|
AllowedMethods:
|
4762
4848
|
- to_ary
|
data/lib/rubocop.rb
CHANGED
@@ -119,6 +119,7 @@ require_relative 'rubocop/cop/mixin/surrounding_space'
|
|
119
119
|
require_relative 'rubocop/cop/mixin/statement_modifier'
|
120
120
|
require_relative 'rubocop/cop/mixin/string_help'
|
121
121
|
require_relative 'rubocop/cop/mixin/string_literals_help'
|
122
|
+
require_relative 'rubocop/cop/mixin/symbol_help'
|
122
123
|
require_relative 'rubocop/cop/mixin/target_ruby_version'
|
123
124
|
require_relative 'rubocop/cop/mixin/trailing_body'
|
124
125
|
require_relative 'rubocop/cop/mixin/trailing_comma'
|
@@ -210,6 +211,7 @@ require_relative 'rubocop/cop/layout/indentation_width'
|
|
210
211
|
require_relative 'rubocop/cop/layout/initial_indentation'
|
211
212
|
require_relative 'rubocop/cop/layout/leading_comment_space'
|
212
213
|
require_relative 'rubocop/cop/layout/leading_empty_lines'
|
214
|
+
require_relative 'rubocop/cop/layout/line_end_string_concatenation_indentation'
|
213
215
|
require_relative 'rubocop/cop/layout/line_length'
|
214
216
|
require_relative 'rubocop/cop/layout/multiline_array_brace_layout'
|
215
217
|
require_relative 'rubocop/cop/layout/multiline_array_line_breaks'
|
@@ -287,6 +289,7 @@ require_relative 'rubocop/cop/lint/empty_conditional_body'
|
|
287
289
|
require_relative 'rubocop/cop/lint/empty_ensure'
|
288
290
|
require_relative 'rubocop/cop/lint/empty_expression'
|
289
291
|
require_relative 'rubocop/cop/lint/empty_file'
|
292
|
+
require_relative 'rubocop/cop/lint/empty_in_pattern'
|
290
293
|
require_relative 'rubocop/cop/lint/empty_interpolation'
|
291
294
|
require_relative 'rubocop/cop/lint/empty_when'
|
292
295
|
require_relative 'rubocop/cop/lint/ensure_return'
|
@@ -398,6 +401,7 @@ require_relative 'rubocop/cop/naming/constant_name'
|
|
398
401
|
require_relative 'rubocop/cop/naming/file_name'
|
399
402
|
require_relative 'rubocop/cop/naming/heredoc_delimiter_case'
|
400
403
|
require_relative 'rubocop/cop/naming/heredoc_delimiter_naming'
|
404
|
+
require_relative 'rubocop/cop/naming/inclusive_language'
|
401
405
|
require_relative 'rubocop/cop/naming/memoized_instance_variable_name'
|
402
406
|
require_relative 'rubocop/cop/naming/method_name'
|
403
407
|
require_relative 'rubocop/cop/naming/method_parameter_name'
|
@@ -490,6 +494,7 @@ require_relative 'rubocop/cop/style/if_unless_modifier_of_if_unless'
|
|
490
494
|
require_relative 'rubocop/cop/style/if_with_boolean_literal_branches'
|
491
495
|
require_relative 'rubocop/cop/style/if_with_semicolon'
|
492
496
|
require_relative 'rubocop/cop/style/implicit_runtime_error'
|
497
|
+
require_relative 'rubocop/cop/style/in_pattern_then'
|
493
498
|
require_relative 'rubocop/cop/style/infinite_loop'
|
494
499
|
require_relative 'rubocop/cop/style/inverse_methods'
|
495
500
|
require_relative 'rubocop/cop/style/inline_comment'
|
@@ -500,6 +505,7 @@ require_relative 'rubocop/cop/style/lambda_call'
|
|
500
505
|
require_relative 'rubocop/cop/style/line_end_concatenation'
|
501
506
|
require_relative 'rubocop/cop/style/method_call_without_args_parentheses'
|
502
507
|
require_relative 'rubocop/cop/style/method_call_with_args_parentheses'
|
508
|
+
require_relative 'rubocop/cop/style/multiline_in_pattern_then'
|
503
509
|
require_relative 'rubocop/cop/style/redundant_assignment'
|
504
510
|
require_relative 'rubocop/cop/style/redundant_fetch_block'
|
505
511
|
require_relative 'rubocop/cop/style/redundant_file_extension_in_require'
|
@@ -550,6 +556,7 @@ require_relative 'rubocop/cop/style/percent_q_literals'
|
|
550
556
|
require_relative 'rubocop/cop/style/perl_backrefs'
|
551
557
|
require_relative 'rubocop/cop/style/preferred_hash_methods'
|
552
558
|
require_relative 'rubocop/cop/style/proc'
|
559
|
+
require_relative 'rubocop/cop/style/quoted_symbols'
|
553
560
|
require_relative 'rubocop/cop/style/raise_args'
|
554
561
|
require_relative 'rubocop/cop/style/random_with_offset'
|
555
562
|
require_relative 'rubocop/cop/style/redundant_argument'
|
@@ -598,6 +605,7 @@ require_relative 'rubocop/cop/style/symbol_array'
|
|
598
605
|
require_relative 'rubocop/cop/style/symbol_literal'
|
599
606
|
require_relative 'rubocop/cop/style/symbol_proc'
|
600
607
|
require_relative 'rubocop/cop/style/ternary_parentheses'
|
608
|
+
require_relative 'rubocop/cop/style/top_level_method_definition'
|
601
609
|
require_relative 'rubocop/cop/style/trailing_body_on_class'
|
602
610
|
require_relative 'rubocop/cop/style/trailing_body_on_method_definition'
|
603
611
|
require_relative 'rubocop/cop/style/trailing_body_on_module'
|