rubocop 1.4.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/config/default.yml +54 -11
  4. data/config/obsoletion.yml +196 -0
  5. data/lib/rubocop.rb +14 -0
  6. data/lib/rubocop/cli.rb +5 -1
  7. data/lib/rubocop/cli/command/suggest_extensions.rb +80 -0
  8. data/lib/rubocop/config_loader.rb +1 -1
  9. data/lib/rubocop/config_loader_resolver.rb +5 -1
  10. data/lib/rubocop/config_obsoletion.rb +65 -247
  11. data/lib/rubocop/config_obsoletion/changed_enforced_styles.rb +33 -0
  12. data/lib/rubocop/config_obsoletion/changed_parameter.rb +21 -0
  13. data/lib/rubocop/config_obsoletion/cop_rule.rb +34 -0
  14. data/lib/rubocop/config_obsoletion/extracted_cop.rb +44 -0
  15. data/lib/rubocop/config_obsoletion/parameter_rule.rb +44 -0
  16. data/lib/rubocop/config_obsoletion/removed_cop.rb +41 -0
  17. data/lib/rubocop/config_obsoletion/renamed_cop.rb +34 -0
  18. data/lib/rubocop/config_obsoletion/rule.rb +41 -0
  19. data/lib/rubocop/config_obsoletion/split_cop.rb +27 -0
  20. data/lib/rubocop/config_validator.rb +18 -4
  21. data/lib/rubocop/cop/autocorrect_logic.rb +21 -6
  22. data/lib/rubocop/cop/base.rb +17 -15
  23. data/lib/rubocop/cop/cop.rb +2 -2
  24. data/lib/rubocop/cop/correctors/string_literal_corrector.rb +6 -8
  25. data/lib/rubocop/cop/generator.rb +1 -1
  26. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +3 -3
  27. data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +6 -1
  28. data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +1 -1
  29. data/lib/rubocop/cop/layout/end_of_line.rb +5 -5
  30. data/lib/rubocop/cop/layout/first_argument_indentation.rb +7 -2
  31. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +12 -0
  32. data/lib/rubocop/cop/layout/line_length.rb +6 -16
  33. data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +7 -3
  34. data/lib/rubocop/cop/lint/interpolation_check.rb +7 -2
  35. data/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb +1 -1
  36. data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +13 -0
  37. data/lib/rubocop/cop/lint/unexpected_block_arity.rb +85 -0
  38. data/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb +7 -2
  39. data/lib/rubocop/cop/metrics/abc_size.rb +25 -1
  40. data/lib/rubocop/cop/metrics/block_length.rb +13 -7
  41. data/lib/rubocop/cop/metrics/method_length.rb +7 -2
  42. data/lib/rubocop/cop/metrics/parameter_lists.rb +64 -1
  43. data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +20 -10
  44. data/lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb +146 -0
  45. data/lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb +6 -1
  46. data/lib/rubocop/cop/migration/department_name.rb +1 -1
  47. data/lib/rubocop/cop/mixin/configurable_numbering.rb +3 -2
  48. data/lib/rubocop/cop/mixin/enforce_superclass.rb +9 -1
  49. data/lib/rubocop/cop/mixin/ignored_methods.rb +36 -3
  50. data/lib/rubocop/cop/mixin/method_complexity.rb +6 -0
  51. data/lib/rubocop/cop/mixin/string_help.rb +4 -1
  52. data/lib/rubocop/cop/naming/accessor_method_name.rb +15 -1
  53. data/lib/rubocop/cop/naming/variable_number.rb +3 -1
  54. data/lib/rubocop/cop/style/and_or.rb +10 -0
  55. data/lib/rubocop/cop/style/character_literal.rb +10 -11
  56. data/lib/rubocop/cop/style/class_and_module_children.rb +8 -3
  57. data/lib/rubocop/cop/style/float_division.rb +44 -1
  58. data/lib/rubocop/cop/style/format_string.rb +8 -3
  59. data/lib/rubocop/cop/style/if_unless_modifier.rb +4 -0
  60. data/lib/rubocop/cop/style/if_with_semicolon.rb +39 -4
  61. data/lib/rubocop/cop/style/ip_addresses.rb +1 -1
  62. data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +11 -2
  63. data/lib/rubocop/cop/style/numeric_literals.rb +14 -11
  64. data/lib/rubocop/cop/style/perl_backrefs.rb +86 -9
  65. data/lib/rubocop/cop/style/redundant_argument.rb +17 -2
  66. data/lib/rubocop/cop/style/redundant_condition.rb +2 -1
  67. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +24 -8
  68. data/lib/rubocop/cop/style/single_line_block_params.rb +30 -7
  69. data/lib/rubocop/cop/style/sole_nested_conditional.rb +65 -3
  70. data/lib/rubocop/cop/style/special_global_vars.rb +1 -13
  71. data/lib/rubocop/cop/style/string_concatenation.rb +26 -1
  72. data/lib/rubocop/cop/style/string_literals.rb +14 -8
  73. data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +4 -3
  74. data/lib/rubocop/cop/style/symbol_proc.rb +5 -3
  75. data/lib/rubocop/core_ext/hash.rb +20 -0
  76. data/lib/rubocop/ext/regexp_node.rb +29 -12
  77. data/lib/rubocop/ext/regexp_parser.rb +20 -9
  78. data/lib/rubocop/formatter/emacs_style_formatter.rb +2 -0
  79. data/lib/rubocop/formatter/simple_text_formatter.rb +2 -0
  80. data/lib/rubocop/formatter/tap_formatter.rb +2 -0
  81. data/lib/rubocop/lockfile.rb +40 -0
  82. data/lib/rubocop/version.rb +1 -1
  83. metadata +32 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 559e608f152814f5300bb7abd0b4c3e094ae53149f9f99a4cef8c4b6dd0da2ab
4
- data.tar.gz: fbee2cd4b7cf20eca1eeec13f67b43b32483a0c8b11c17829f705c9c529446f0
3
+ metadata.gz: ae0bcfc68121984fb71e933b1a00aa8d418d99dd4005cce76e986d6c387c0e50
4
+ data.tar.gz: '0465797f84ca499f634aac95e745a4192bb62d68f5d935b4a7e21b925893b131'
5
5
  SHA512:
6
- metadata.gz: b9dd79f49f7bca665d5e9d05cc6e41a6ba5cdff9f4392b9ed5d8a25ec714966b661d8bfef677087cbd4b3ec29c55afb3dbe08e00ffbd7df34385f1ca60ec1312
7
- data.tar.gz: e36d6e3f839d586fd2776767eb4eff2228c5378f90a56726497b5cc37b1b890f1da33d0c76b47cbfdb3e141debb5eeaee63f41914d03cbd2d2cd819361f5301e
6
+ metadata.gz: eb0e28d3926209e380aed52e134801e3e206cf9ca1bace01e133223ddfe37507a888a70b629cefb7711951eaffd089078daa0a7065cf0730ccfd79febe80f1ff
7
+ data.tar.gz: 17fcb97b537f9529a5bb484d85f5873f1745905712472586550f463cf689465f12aaa291efcf9371babc17b8ca7e5b2d5a99d7f6a46c800fdb3dba8dca58989e
data/README.md CHANGED
@@ -51,7 +51,7 @@ To prevent an unwanted RuboCop update you might want to use a conservative versi
51
51
  in your `Gemfile`:
52
52
 
53
53
  ```rb
54
- gem 'rubocop', '~> 1.4', require: false
54
+ gem 'rubocop', '~> 1.6', require: false
55
55
  ```
56
56
 
57
57
  See [versioning](https://docs.rubocop.org/rubocop/1.0/versioning.html) for further details.
@@ -139,6 +139,16 @@ AllCops:
139
139
  # from the lock file.) If the Ruby version is still unresolved, RuboCop will
140
140
  # use the oldest officially supported Ruby version (currently Ruby 2.4).
141
141
  TargetRubyVersion: ~
142
+ # Determines if a notification for extension libraries should be shown when
143
+ # rubocop is run. Keys are the name of the extension, and values are an array
144
+ # of gems in the Gemfile that the extension is suggested for, if not already
145
+ # included.
146
+ SuggestExtensions:
147
+ rubocop-rails: [rails]
148
+ rubocop-rspec: [rspec, rspec-rails]
149
+ rubocop-minitest: [minitest]
150
+ rubocop-sequel: [sequel]
151
+ rubocop-rake: [rake]
142
152
 
143
153
  #################### Bundler ###############################
144
154
 
@@ -459,7 +469,7 @@ Layout/EmptyLineAfterMultilineCondition:
459
469
  - https://github.com/airbnb/ruby#multiline-if-newline
460
470
 
461
471
  Layout/EmptyLineBetweenDefs:
462
- Description: 'Use empty lines between defs.'
472
+ Description: 'Use empty lines between class/module/method defs.'
463
473
  StyleGuide: '#empty-lines-between-methods'
464
474
  Enabled: true
465
475
  VersionAdded: '0.49'
@@ -1998,6 +2008,23 @@ Lint/UnderscorePrefixedVariableName:
1998
2008
  VersionAdded: '0.21'
1999
2009
  AllowKeywordBlockArguments: false
2000
2010
 
2011
+ Lint/UnexpectedBlockArity:
2012
+ Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
2013
+ Enabled: pending
2014
+ Safe: false
2015
+ VersionAdded: '1.5'
2016
+ Methods:
2017
+ chunk_while: 2
2018
+ each_with_index: 2
2019
+ each_with_object: 2
2020
+ inject: 2
2021
+ max: 2
2022
+ min: 2
2023
+ minmax: 2
2024
+ reduce: 2
2025
+ slice_when: 2
2026
+ sort: 2
2027
+
2001
2028
  Lint/UnifiedInteger:
2002
2029
  Description: 'Use Integer instead of Fixnum or Bignum.'
2003
2030
  Enabled: true
@@ -2007,6 +2034,7 @@ Lint/UnmodifiedReduceAccumulator:
2007
2034
  Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
2008
2035
  Enabled: pending
2009
2036
  VersionAdded: '1.1'
2037
+ VersionChanged: '1.5'
2010
2038
 
2011
2039
  Lint/UnreachableCode:
2012
2040
  Description: 'Unreachable code.'
@@ -2110,21 +2138,23 @@ Metrics/AbcSize:
2110
2138
  - https://en.wikipedia.org/wiki/ABC_Software_Metric
2111
2139
  Enabled: true
2112
2140
  VersionAdded: '0.27'
2113
- VersionChanged: '0.81'
2141
+ VersionChanged: '1.5'
2114
2142
  # The ABC size is a calculated magnitude, so this number can be an Integer or
2115
2143
  # a Float.
2116
2144
  IgnoredMethods: []
2145
+ CountRepeatedAttributes: true
2117
2146
  Max: 17
2118
2147
 
2119
2148
  Metrics/BlockLength:
2120
2149
  Description: 'Avoid long blocks with many lines.'
2121
2150
  Enabled: true
2122
2151
  VersionAdded: '0.44'
2123
- VersionChanged: '0.87'
2152
+ VersionChanged: '1.5'
2124
2153
  CountComments: false # count full line comments?
2125
2154
  Max: 25
2126
2155
  CountAsOne: []
2127
- ExcludedMethods:
2156
+ ExcludedMethods: [] # deprecated, retained for backwards compatibility
2157
+ IgnoredMethods:
2128
2158
  # By default, exclude the `#refine` method, as it tends to have larger
2129
2159
  # associated blocks.
2130
2160
  - refine
@@ -2165,11 +2195,12 @@ Metrics/MethodLength:
2165
2195
  StyleGuide: '#short-methods'
2166
2196
  Enabled: true
2167
2197
  VersionAdded: '0.25'
2168
- VersionChanged: '0.87'
2198
+ VersionChanged: '1.5'
2169
2199
  CountComments: false # count full line comments?
2170
2200
  Max: 10
2171
2201
  CountAsOne: []
2172
- ExcludedMethods: []
2202
+ ExcludedMethods: [] # deprecated, retained for backwards compatibility
2203
+ IgnoredMethods: []
2173
2204
 
2174
2205
  Metrics/ModuleLength:
2175
2206
  Description: 'Avoid modules longer than 100 lines of code.'
@@ -2185,8 +2216,10 @@ Metrics/ParameterLists:
2185
2216
  StyleGuide: '#too-many-params'
2186
2217
  Enabled: true
2187
2218
  VersionAdded: '0.25'
2219
+ VersionChanged: '1.5'
2188
2220
  Max: 5
2189
2221
  CountKeywordArgs: true
2222
+ MaxOptionalParameters: 3
2190
2223
 
2191
2224
  Metrics/PerceivedComplexity:
2192
2225
  Description: >-
@@ -2456,7 +2489,7 @@ Naming/VariableNumber:
2456
2489
  StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
2457
2490
  Enabled: true
2458
2491
  VersionAdded: '0.50'
2459
- VersionChanged: '1.3'
2492
+ VersionChanged: '1.4'
2460
2493
  EnforcedStyle: normalcase
2461
2494
  SupportedStyles:
2462
2495
  - snake_case
@@ -2464,7 +2497,13 @@ Naming/VariableNumber:
2464
2497
  - non_integer
2465
2498
  CheckMethodNames: true
2466
2499
  CheckSymbols: true
2467
- AllowedIdentifiers: []
2500
+ AllowedIdentifiers:
2501
+ - capture3 # Open3.capture3
2502
+ - iso8601 # Time#iso8601
2503
+ - rfc1123_date # CGI.rfc1123_date
2504
+ - rfc822 # Time#rfc822
2505
+ - rfc2822 # Time#rfc2822
2506
+ - rfc3339 # DateTime.rfc3339
2468
2507
 
2469
2508
  #################### Security ##############################
2470
2509
 
@@ -3170,9 +3209,10 @@ Style/ExponentialNotation:
3170
3209
  Style/FloatDivision:
3171
3210
  Description: 'For performing float division, coerce one side only.'
3172
3211
  StyleGuide: '#float-division'
3173
- Reference: 'https://github.com/rubocop-hq/ruby-style-guide/issues/628'
3212
+ Reference: 'https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html'
3174
3213
  Enabled: true
3175
3214
  VersionAdded: '0.72'
3215
+ VersionChanged: '1.6'
3176
3216
  EnforcedStyle: single_coerce
3177
3217
  SupportedStyles:
3178
3218
  - left_coerce
@@ -3986,6 +4026,7 @@ Style/RedundantArgument:
3986
4026
  Enabled: pending
3987
4027
  Safe: false
3988
4028
  VersionAdded: '1.4'
4029
+ VersionChanged: '1.6'
3989
4030
  Methods:
3990
4031
  # Array#join
3991
4032
  join: ''
@@ -4233,7 +4274,7 @@ Style/SingleLineBlockParams:
4233
4274
  Description: 'Enforces the names of some block params.'
4234
4275
  Enabled: false
4235
4276
  VersionAdded: '0.16'
4236
- VersionChanged: '0.47'
4277
+ VersionChanged: '1.6'
4237
4278
  Methods:
4238
4279
  - reduce:
4239
4280
  - acc
@@ -4262,6 +4303,7 @@ Style/SoleNestedConditional:
4262
4303
  which can be merged into outer conditional node.
4263
4304
  Enabled: true
4264
4305
  VersionAdded: '0.89'
4306
+ VersionChanged: '1.5'
4265
4307
  AllowModifier: false
4266
4308
 
4267
4309
  Style/SpecialGlobalVars:
@@ -4305,6 +4347,7 @@ Style/StringConcatenation:
4305
4347
  Enabled: true
4306
4348
  Safe: false
4307
4349
  VersionAdded: '0.89'
4350
+ VersionChanged: '1.6'
4308
4351
 
4309
4352
  Style/StringHashKeys:
4310
4353
  Description: 'Prefer symbols instead of strings as hash keys.'
@@ -4394,7 +4437,7 @@ Style/SymbolProc:
4394
4437
  Enabled: true
4395
4438
  Safe: false
4396
4439
  VersionAdded: '0.26'
4397
- VersionChanged: '0.64'
4440
+ VersionChanged: '1.5'
4398
4441
  # A list of method names to be ignored by the check.
4399
4442
  # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
4400
4443
  IgnoredMethods:
@@ -0,0 +1,196 @@
1
+ # Configuration of obsolete/deprecated cops used by `ConfigObsoletion`
2
+
3
+ # Cops that were renamed
4
+ renamed:
5
+ Layout/AlignArguments: Layout/ArgumentAlignment
6
+ Layout/AlignArray: Layout/ArrayAlignment
7
+ Layout/AlignHash: Layout/HashAlignment
8
+ Layout/AlignParameters: Layout/ParameterAlignment
9
+ Layout/IndentArray: Layout/FirstArrayElementIndentation
10
+ Layout/IndentAssignment: Layout/AssignmentIndentation
11
+ Layout/IndentFirstArgument: Layout/FirstArgumentIndentation
12
+ Layout/IndentFirstArrayElement: Layout/FirstArrayElementIndentation
13
+ Layout/IndentFirstHashElement: Layout/FirstHashElementIndentation
14
+ Layout/IndentFirstParameter: Layout/FirstParameterIndentation
15
+ Layout/IndentHash: Layout/FirstHashElementIndentation
16
+ Layout/IndentHeredoc: Layout/HeredocIndentation
17
+ Layout/LeadingBlankLines: Layout/LeadingEmptyLines
18
+ Layout/Tab: Layout/IndentationStyle
19
+ Layout/TrailingBlankLines: Layout/TrailingEmptyLines
20
+ Lint/BlockAlignment: Layout/BlockAlignment
21
+ Lint/DefEndAlignment: Layout/DefEndAlignment
22
+ Lint/DuplicatedKey: Lint/DuplicateHashKey
23
+ Lint/EndAlignment: Layout/EndAlignment
24
+ Lint/EndInMethod: Style/EndBlock
25
+ Lint/Eval: Security/Eval
26
+ Lint/HandleExceptions: Lint/SuppressedException
27
+ Lint/MultipleCompare: Lint/MultipleComparison
28
+ Lint/StringConversionInInterpolation: Lint/RedundantStringCoercion
29
+ Lint/UnneededCopDisableDirective: Lint/RedundantCopDisableDirective
30
+ Lint/UnneededCopEnableDirective: Lint/RedundantCopEnableDirective
31
+ Lint/UnneededRequireStatement: Lint/RedundantRequireStatement
32
+ Lint/UnneededSplatExpansion: Lint/RedundantSplatExpansion
33
+ Metrics/LineLength: Layout/LineLength
34
+ Naming/UncommunicativeBlockParamName: Naming/BlockParameterName
35
+ Naming/UncommunicativeMethodParamName: Naming/MethodParameterName
36
+ Style/AccessorMethodName: Naming/AccessorMethodName
37
+ Style/AsciiIdentifiers: Naming/AsciiIdentifiers
38
+ Style/ClassAndModuleCamelCase: Naming/ClassAndModuleCamelCase
39
+ Style/ConstantName: Naming/ConstantName
40
+ Style/DeprecatedHashMethods: Style/PreferredHashMethods
41
+ Style/FileName: Naming/FileName
42
+ Style/FlipFlop: Lint/FlipFlop
43
+ Style/MethodCallParentheses: Style/MethodCallWithoutArgsParentheses
44
+ Style/MethodName: Naming/MethodName
45
+ Style/OpMethod: Naming/BinaryOperatorParameterName
46
+ Style/PredicateName: Naming/PredicateName
47
+ Style/SingleSpaceBeforeFirstArg: Layout/SpaceBeforeFirstArg
48
+ Style/UnneededCapitalW: Style/RedundantCapitalW
49
+ Style/UnneededCondition: Style/RedundantCondition
50
+ Style/UnneededInterpolation: Style/RedundantInterpolation
51
+ Style/UnneededPercentQ: Style/RedundantPercentQ
52
+ Style/UnneededSort: Style/RedundantSort
53
+ Style/VariableName: Naming/VariableName
54
+ Style/VariableNumber: Naming/VariableNumber
55
+
56
+ # Cops that were removed
57
+ removed:
58
+ Layout/SpaceAfterControlKeyword:
59
+ alternatives: Layout/SpaceAroundKeyword
60
+ Layout/SpaceBeforeModifierKeyword:
61
+ alternatives: Layout/SpaceAroundKeyword
62
+ Lint/InvalidCharacterLiteral:
63
+ reason: it was never being actually triggered
64
+ Lint/RescueWithoutErrorClass:
65
+ alternatives: Style/RescueStandardError
66
+ Lint/SpaceBeforeFirstArg:
67
+ reason: >
68
+ it was a duplicate of `Layout/SpaceBeforeFirstArg`. Please use
69
+ `Layout/SpaceBeforeFirstArg` instead
70
+ Lint/UselessComparison:
71
+ reason: >
72
+ it has been superseded by
73
+ `Lint/BinaryOperatorWithIdenticalOperands`. Please use
74
+ `Lint/BinaryOperatorWithIdenticalOperands` instead
75
+ Style/BracesAroundHashParameters: true
76
+ Style/MethodMissingSuper:
77
+ reason: >
78
+ it has been superseded by `Lint/MissingSuper`. Please use
79
+ `Lint/MissingSuper` instead
80
+ Style/SpaceAfterControlKeyword:
81
+ alternatives: Layout/SpaceAroundKeyword
82
+ Style/SpaceBeforeModifierKeyword:
83
+ alternatives: Layout/SpaceAroundKeyword
84
+ Style/TrailingComma:
85
+ alternatives:
86
+ - Style/TrailingCommaInArguments
87
+ - Style/TrailingCommaInArrayLiteral
88
+ - Style/TrailingCommaInHashLiteral
89
+ Style/TrailingCommaInLiteral:
90
+ alternatives:
91
+ - Style/TrailingCommaInArrayLiteral
92
+ - Style/TrailingCommaInHashLiteral
93
+
94
+ # Cops split into multiple other cops
95
+ split:
96
+ Style/MethodMissing:
97
+ alternatives:
98
+ - Style/MethodMissingSuper
99
+ - Style/MissingRespondToMissing
100
+
101
+ # Cops that were extracted into a different gem
102
+ extracted:
103
+ Performance/*: rubocop-performance
104
+ Rails/*: rubocop-rails
105
+
106
+ # Cop parameters that have been changed
107
+ # Can be treated as a warning instead of a failure with `severity: warning`
108
+ changed_parameters:
109
+ - cops:
110
+ - Layout/SpaceAroundOperators
111
+ - Style/SpaceAroundOperators
112
+ parameters: MultiSpaceAllowedForOperators
113
+ reason: >
114
+ If your intention was to allow extra spaces for alignment, please
115
+ use `AllowForAlignment: true` instead.
116
+ - cops: Style/Encoding
117
+ parameters:
118
+ - EnforcedStyle
119
+ - SupportedStyles
120
+ - AutoCorrectEncodingComment
121
+ reason: '`Style/Encoding` no longer supports styles. The "never" behavior is always assumed.'
122
+ - cops: Style/IfUnlessModifier
123
+ parameters: MaxLineLength
124
+ reason: >
125
+ `Style/IfUnlessModifier: MaxLineLength` has been removed.
126
+ Use `Layout/LineLength: Max` instead
127
+ - cops: Style/WhileUntilModifier
128
+ parameters: MaxLineLength
129
+ reason: >
130
+ `Style/WhileUntilModifier: MaxLineLength` has been removed.
131
+ Use `Layout/LineLength: Max` instead
132
+ - cops: AllCops
133
+ parameters: RunRailsCops
134
+ reason: |-
135
+ Use the following configuration instead:
136
+ Rails:
137
+ Enabled: true
138
+ - cops: Layout/CaseIndentation
139
+ parameters: IndentWhenRelativeTo
140
+ alternative: EnforcedStyle
141
+ - cops:
142
+ - Lint/BlockAlignment
143
+ - Layout/BlockAlignment
144
+ - Lint/EndAlignment
145
+ - Layout/EndAlignment
146
+ - Lint/DefEndAlignment
147
+ - Layout/DefEndAlignment
148
+ parameters: AlignWith
149
+ alternative: EnforcedStyleAlignWith
150
+ - cops: Rails/UniqBeforePluck
151
+ parameters: EnforcedMode
152
+ alternative: EnforcedStyle
153
+ - cops: Style/MethodCallWithArgsParentheses
154
+ parameters: IgnoredMethodPatterns
155
+ alternative: IgnoredPatterns
156
+ - cops:
157
+ - Performance/Count
158
+ - Performance/Detect
159
+ parameters: SafeMode
160
+ reason: "`SafeMode` has been removed. Use `SafeAutoCorrect` instead."
161
+ - cops: Bundler/GemComment
162
+ parameters: Whitelist
163
+ alternative: IgnoredGems
164
+ - cops:
165
+ - Lint/SafeNavigationChain
166
+ - Lint/SafeNavigationConsistency
167
+ - Style/NestedParenthesizedCalls
168
+ - Style/SafeNavigation
169
+ - Style/TrivialAccessors
170
+ parameters: Whitelist
171
+ alternative: AllowedMethods
172
+ - cops: Style/IpAddresses
173
+ parameters: Whitelist
174
+ alternative: AllowedAddresses
175
+ - cops: Naming/HeredocDelimiterNaming
176
+ parameters: Blacklist
177
+ alternative: ForbiddenDelimiters
178
+ - cops: Naming/PredicateName
179
+ parameters: NamePrefixBlacklist
180
+ alternative: ForbiddenPrefixes
181
+ - cops: Naming/PredicateName
182
+ parameters: NameWhitelist
183
+ alternative: AllowedMethods
184
+ - cops:
185
+ - Metrics/BlockLength
186
+ - Metrics/MethodLength
187
+ parameters: ExcludedMethods
188
+ alternative: IgnoredMethods
189
+ severity: warning
190
+
191
+ # Enforced styles that have been removed or replaced
192
+ changed_enforced_styles:
193
+ - cops: Layout/IndentationConsistency
194
+ parameters: EnforcedStyle
195
+ value: rails
196
+ alternative: indented_internal_methods
@@ -18,6 +18,7 @@ require_relative 'rubocop/ext/regexp_node'
18
18
  require_relative 'rubocop/ext/regexp_parser'
19
19
 
20
20
  require_relative 'rubocop/core_ext/string'
21
+ require_relative 'rubocop/core_ext/hash'
21
22
  require_relative 'rubocop/ext/processed_source'
22
23
 
23
24
  require_relative 'rubocop/path_util'
@@ -88,6 +89,7 @@ require_relative 'rubocop/cop/mixin/interpolation'
88
89
  require_relative 'rubocop/cop/mixin/line_length_help'
89
90
  require_relative 'rubocop/cop/mixin/match_range'
90
91
  require_relative 'rubocop/cop/metrics/utils/repeated_csend_discount'
92
+ require_relative 'rubocop/cop/metrics/utils/repeated_attribute_discount'
91
93
  require_relative 'rubocop/cop/mixin/method_complexity'
92
94
  require_relative 'rubocop/cop/mixin/method_preference'
93
95
  require_relative 'rubocop/cop/mixin/min_body_length'
@@ -341,6 +343,7 @@ require_relative 'rubocop/cop/lint/to_json'
341
343
  require_relative 'rubocop/cop/lint/top_level_return_with_argument'
342
344
  require_relative 'rubocop/cop/lint/trailing_comma_in_attribute_declaration'
343
345
  require_relative 'rubocop/cop/lint/underscore_prefixed_variable_name'
346
+ require_relative 'rubocop/cop/lint/unexpected_block_arity'
344
347
  require_relative 'rubocop/cop/lint/unified_integer'
345
348
  require_relative 'rubocop/cop/lint/unmodified_reduce_accumulator'
346
349
  require_relative 'rubocop/cop/lint/unreachable_code'
@@ -629,9 +632,19 @@ require_relative 'rubocop/cached_data'
629
632
  require_relative 'rubocop/config'
630
633
  require_relative 'rubocop/config_loader_resolver'
631
634
  require_relative 'rubocop/config_loader'
635
+ require_relative 'rubocop/config_obsoletion/rule'
636
+ require_relative 'rubocop/config_obsoletion/cop_rule'
637
+ require_relative 'rubocop/config_obsoletion/parameter_rule'
638
+ require_relative 'rubocop/config_obsoletion/changed_enforced_styles'
639
+ require_relative 'rubocop/config_obsoletion/changed_parameter'
640
+ require_relative 'rubocop/config_obsoletion/extracted_cop'
641
+ require_relative 'rubocop/config_obsoletion/removed_cop'
642
+ require_relative 'rubocop/config_obsoletion/renamed_cop'
643
+ require_relative 'rubocop/config_obsoletion/split_cop'
632
644
  require_relative 'rubocop/config_obsoletion'
633
645
  require_relative 'rubocop/config_store'
634
646
  require_relative 'rubocop/config_validator'
647
+ require_relative 'rubocop/lockfile'
635
648
  require_relative 'rubocop/target_finder'
636
649
  require_relative 'rubocop/directive_comment'
637
650
  require_relative 'rubocop/comment_config'
@@ -646,6 +659,7 @@ require_relative 'rubocop/cli/command/auto_genenerate_config'
646
659
  require_relative 'rubocop/cli/command/execute_runner'
647
660
  require_relative 'rubocop/cli/command/init_dotfile'
648
661
  require_relative 'rubocop/cli/command/show_cops'
662
+ require_relative 'rubocop/cli/command/suggest_extensions'
649
663
  require_relative 'rubocop/cli/command/version'
650
664
  require_relative 'rubocop/config_regeneration'
651
665
  require_relative 'rubocop/options'