rubocop 0.76.0 → 0.80.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +4 -4
- data/config/default.yml +325 -283
- data/lib/rubocop.rb +43 -23
- data/lib/rubocop/ast/builder.rb +43 -42
- data/lib/rubocop/ast/node.rb +1 -13
- data/lib/rubocop/ast/node/block_node.rb +2 -0
- data/lib/rubocop/ast/node/def_node.rb +11 -0
- data/lib/rubocop/ast/node/forward_args_node.rb +18 -0
- data/lib/rubocop/ast/node/regexp_node.rb +2 -4
- data/lib/rubocop/ast/traversal.rb +20 -3
- data/lib/rubocop/cli.rb +11 -230
- data/lib/rubocop/cli/command.rb +21 -0
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +105 -0
- data/lib/rubocop/cli/command/base.rb +33 -0
- data/lib/rubocop/cli/command/execute_runner.rb +76 -0
- data/lib/rubocop/cli/command/init_dotfile.rb +45 -0
- data/lib/rubocop/cli/command/show_cops.rb +80 -0
- data/lib/rubocop/cli/command/version.rb +17 -0
- data/lib/rubocop/cli/environment.rb +21 -0
- data/lib/rubocop/comment_config.rb +6 -1
- data/lib/rubocop/config.rb +28 -10
- data/lib/rubocop/config_loader.rb +19 -19
- data/lib/rubocop/config_obsoletion.rb +65 -11
- data/lib/rubocop/config_validator.rb +56 -98
- data/lib/rubocop/cop/autocorrect_logic.rb +7 -4
- data/lib/rubocop/cop/bundler/gem_comment.rb +4 -4
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +2 -2
- data/lib/rubocop/cop/cop.rb +21 -0
- data/lib/rubocop/cop/correctors/space_corrector.rb +1 -2
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -1
- data/lib/rubocop/cop/generator.rb +3 -4
- data/lib/rubocop/cop/generator/configuration_injector.rb +1 -1
- data/lib/rubocop/cop/internal_affairs.rb +1 -0
- data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +59 -0
- data/lib/rubocop/cop/layout/{align_arguments.rb → argument_alignment.rb} +1 -1
- data/lib/rubocop/cop/layout/{align_array.rb → array_alignment.rb} +1 -1
- data/lib/rubocop/cop/layout/{indent_assignment.rb → assignment_indentation.rb} +1 -1
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +2 -1
- data/lib/rubocop/cop/layout/extra_spacing.rb +1 -1
- data/lib/rubocop/cop/layout/{indent_first_argument.rb → first_argument_indentation.rb} +5 -5
- data/lib/rubocop/cop/layout/{indent_first_array_element.rb → first_array_element_indentation.rb} +4 -4
- data/lib/rubocop/cop/layout/{indent_first_hash_element.rb → first_hash_element_indentation.rb} +3 -3
- data/lib/rubocop/cop/layout/{indent_first_parameter.rb → first_parameter_indentation.rb} +3 -3
- data/lib/rubocop/cop/layout/{align_hash.rb → hash_alignment.rb} +10 -6
- data/lib/rubocop/cop/layout/{indent_heredoc.rb → heredoc_indentation.rb} +5 -5
- data/lib/rubocop/cop/layout/leading_comment_space.rb +33 -2
- data/lib/rubocop/cop/layout/{leading_blank_lines.rb → leading_empty_lines.rb} +1 -1
- data/lib/rubocop/cop/{metrics → layout}/line_length.rb +67 -108
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +14 -5
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +0 -4
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
- data/lib/rubocop/cop/layout/{align_parameters.rb → parameter_alignment.rb} +1 -1
- data/lib/rubocop/cop/layout/space_around_keyword.rb +12 -0
- data/lib/rubocop/cop/layout/space_around_operators.rb +50 -7
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +17 -0
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +8 -0
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +2 -9
- data/lib/rubocop/cop/layout/{trailing_blank_lines.rb → trailing_empty_lines.rb} +1 -1
- data/lib/rubocop/cop/lint/debugger.rb +1 -1
- data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +1 -1
- data/lib/rubocop/cop/lint/{duplicated_key.rb → duplicate_hash_key.rb} +1 -1
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +1 -1
- data/lib/rubocop/cop/lint/{multiple_compare.rb → multiple_comparison.rb} +1 -1
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +89 -0
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +3 -3
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +13 -8
- data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +1 -1
- data/lib/rubocop/cop/lint/{string_conversion_in_interpolation.rb → redundant_string_coercion.rb} +1 -1
- data/lib/rubocop/cop/lint/redundant_with_index.rb +2 -2
- data/lib/rubocop/cop/lint/redundant_with_object.rb +2 -2
- data/lib/rubocop/cop/lint/{handle_exceptions.rb → suppressed_exception.rb} +1 -1
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +57 -23
- data/lib/rubocop/cop/lint/useless_setter_call.rb +5 -1
- data/lib/rubocop/cop/metrics/method_length.rb +1 -1
- data/lib/rubocop/cop/migration/department_name.rb +30 -2
- data/lib/rubocop/cop/mixin/alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +4 -0
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +7 -7
- data/lib/rubocop/cop/mixin/{hash_alignment.rb → hash_alignment_styles.rb} +1 -1
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +171 -0
- data/lib/rubocop/cop/mixin/line_length_help.rb +88 -0
- data/lib/rubocop/cop/mixin/nil_methods.rb +4 -4
- data/lib/rubocop/cop/mixin/rational_literal.rb +18 -0
- data/lib/rubocop/cop/mixin/statement_modifier.rb +2 -2
- data/lib/rubocop/cop/mixin/trailing_comma.rb +8 -12
- data/lib/rubocop/cop/naming/{uncommunicative_block_param_name.rb → block_parameter_name.rb} +3 -3
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +5 -5
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +1 -1
- data/lib/rubocop/cop/naming/{uncommunicative_method_param_name.rb → method_parameter_name.rb} +4 -4
- data/lib/rubocop/cop/naming/predicate_name.rb +6 -6
- data/lib/rubocop/cop/offense.rb +11 -0
- data/lib/rubocop/cop/registry.rb +7 -2
- data/lib/rubocop/cop/style/alias.rb +1 -1
- data/lib/rubocop/cop/style/array_join.rb +1 -1
- data/lib/rubocop/cop/style/attr.rb +8 -0
- data/lib/rubocop/cop/style/block_delimiters.rb +60 -1
- data/lib/rubocop/cop/style/conditional_assignment.rb +2 -2
- data/lib/rubocop/cop/style/eval_with_location.rb +1 -1
- data/lib/rubocop/cop/style/even_odd.rb +1 -1
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +89 -11
- data/lib/rubocop/cop/style/guard_clause.rb +3 -2
- data/lib/rubocop/cop/style/hash_each_methods.rb +87 -0
- data/lib/rubocop/cop/style/hash_transform_keys.rb +79 -0
- data/lib/rubocop/cop/style/hash_transform_values.rb +79 -0
- data/lib/rubocop/cop/style/if_unless_modifier.rb +38 -3
- data/lib/rubocop/cop/style/infinite_loop.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +8 -4
- data/lib/rubocop/cop/style/ip_addresses.rb +4 -4
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +7 -205
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +169 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +54 -0
- data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
- data/lib/rubocop/cop/style/multiline_method_signature.rb +1 -1
- data/lib/rubocop/cop/style/multiline_when_then.rb +5 -1
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +7 -7
- data/lib/rubocop/cop/style/next.rb +5 -5
- data/lib/rubocop/cop/style/numeric_literals.rb +7 -3
- data/lib/rubocop/cop/style/numeric_predicate.rb +4 -3
- data/lib/rubocop/cop/style/option_hash.rb +3 -3
- data/lib/rubocop/cop/style/or_assignment.rb +3 -2
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +7 -7
- data/lib/rubocop/cop/style/redundant_condition.rb +17 -4
- data/lib/rubocop/cop/style/redundant_parentheses.rb +3 -3
- data/lib/rubocop/cop/style/redundant_return.rb +2 -8
- data/lib/rubocop/cop/style/redundant_sort.rb +1 -1
- data/lib/rubocop/cop/style/symbol_array.rb +2 -2
- data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +0 -22
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +7 -1
- data/lib/rubocop/cop/style/trivial_accessors.rb +5 -5
- data/lib/rubocop/cop/style/while_until_modifier.rb +1 -1
- data/lib/rubocop/cop/style/yoda_condition.rb +16 -1
- data/lib/rubocop/cop/team.rb +5 -0
- data/lib/rubocop/cop/variable_force.rb +4 -1
- data/lib/rubocop/formatter/base_formatter.rb +2 -2
- data/lib/rubocop/formatter/clang_style_formatter.rb +1 -3
- data/lib/rubocop/formatter/formatter_set.rb +1 -0
- data/lib/rubocop/formatter/json_formatter.rb +6 -5
- data/lib/rubocop/formatter/junit_formatter.rb +63 -0
- data/lib/rubocop/formatter/tap_formatter.rb +1 -3
- data/lib/rubocop/node_pattern.rb +97 -11
- data/lib/rubocop/options.rb +8 -8
- data/lib/rubocop/processed_source.rb +1 -1
- data/lib/rubocop/rake_task.rb +1 -0
- data/lib/rubocop/result_cache.rb +23 -7
- data/lib/rubocop/rspec/shared_contexts.rb +5 -0
- data/lib/rubocop/runner.rb +18 -2
- data/lib/rubocop/target_ruby.rb +151 -0
- data/lib/rubocop/version.rb +1 -1
- metadata +60 -27
- data/lib/rubocop/cop/mixin/safe_mode.rb +0 -24
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +0 -209
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4837832a6eb4686ba49145b2668aea7b94d85f3b23d24eb49c05ff9b456393b4
|
4
|
+
data.tar.gz: 1d72140d3461ddf8f64eb1218a78f76603b400e09cb902f1bed6e036650c0d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4637362ae937c8e659c62d5d4e305342f9580652551356a5178ae3861fa680ac3a7ba27a8eaf0869c73de5c66c16a3ed53d1377aba4d1ad9616dd3e69ce2f761
|
7
|
+
data.tar.gz: aada4e63308932e7847e94de67565942cbc4b12ae41663a1cb1984228988580e7322612c8c3a73337ae54baa0af9dc0b133f627c44c54a39994f86c0c588b976
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -41,7 +41,7 @@ automatically fix some of the problems for you.
|
|
41
41
|
$ gem install rubocop
|
42
42
|
```
|
43
43
|
|
44
|
-
If you'd rather install RuboCop using `bundler`,
|
44
|
+
If you'd rather install RuboCop using `bundler`, add a line for it in your `Gemfile` (but set the `require` option to `false`, as it is a standalone tool):
|
45
45
|
|
46
46
|
```rb
|
47
47
|
gem 'rubocop', require: false
|
@@ -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 lock in your `Gemfile`:
|
54
54
|
|
55
55
|
```rb
|
56
|
-
gem 'rubocop', '~> 0.
|
56
|
+
gem 'rubocop', '~> 0.80.1', require: false
|
57
57
|
```
|
58
58
|
|
59
59
|
## Quickstart
|
@@ -74,7 +74,7 @@ You can read a lot more about RuboCop in its [official docs](https://docs.ruboco
|
|
74
74
|
RuboCop supports the following Ruby implementations:
|
75
75
|
|
76
76
|
* MRI 2.3+
|
77
|
-
* JRuby 9.
|
77
|
+
* JRuby 9.2+
|
78
78
|
|
79
79
|
## Team
|
80
80
|
|
@@ -213,5 +213,5 @@ RuboCop's changelog is available [here](CHANGELOG.md).
|
|
213
213
|
|
214
214
|
## Copyright
|
215
215
|
|
216
|
-
Copyright (c) 2012-
|
216
|
+
Copyright (c) 2012-2020 Bozhidar Batsov. See [LICENSE.txt](LICENSE.txt) for
|
217
217
|
further details.
|
data/config/default.yml
CHANGED
@@ -54,11 +54,13 @@ AllCops:
|
|
54
54
|
- '**/Puppetfile'
|
55
55
|
- '**/Rakefile'
|
56
56
|
- '**/Snapfile'
|
57
|
+
- '**/Steepfile'
|
57
58
|
- '**/Thorfile'
|
58
59
|
- '**/Vagabondfile'
|
59
60
|
- '**/Vagrantfile'
|
60
61
|
Exclude:
|
61
62
|
- 'node_modules/**/*'
|
63
|
+
- 'tmp/**/*'
|
62
64
|
- 'vendor/**/*'
|
63
65
|
- '.git/**/*'
|
64
66
|
# Default formatter will be used if no `-f/--format` option is given.
|
@@ -141,11 +143,12 @@ Bundler/GemComment:
|
|
141
143
|
Description: 'Add a comment describing each gem.'
|
142
144
|
Enabled: false
|
143
145
|
VersionAdded: '0.59'
|
146
|
+
VersionChanged: '0.77'
|
144
147
|
Include:
|
145
148
|
- '**/*.gemfile'
|
146
149
|
- '**/Gemfile'
|
147
150
|
- '**/gems.rb'
|
148
|
-
|
151
|
+
IgnoredGems: []
|
149
152
|
|
150
153
|
Bundler/InsecureProtocolSource:
|
151
154
|
Description: >-
|
@@ -195,9 +198,10 @@ Gemspec/RequiredRubyVersion:
|
|
195
198
|
VersionAdded: '0.52'
|
196
199
|
Include:
|
197
200
|
- '**/*.gemspec'
|
198
|
-
|
201
|
+
|
199
202
|
Gemspec/RubyVersionGlobalsUsage:
|
200
203
|
Description: Checks usage of RUBY_VERSION in gemspec.
|
204
|
+
StyleGuide: '#no-ruby-version-in-the-gemspec'
|
201
205
|
Enabled: true
|
202
206
|
VersionAdded: '0.72'
|
203
207
|
Include:
|
@@ -218,13 +222,14 @@ Layout/AccessModifierIndentation:
|
|
218
222
|
# But it can be overridden by setting this parameter
|
219
223
|
IndentationWidth: ~
|
220
224
|
|
221
|
-
Layout/
|
225
|
+
Layout/ArgumentAlignment:
|
222
226
|
Description: >-
|
223
227
|
Align the arguments of a method call if they span more
|
224
228
|
than one line.
|
225
229
|
StyleGuide: '#no-double-indent'
|
226
230
|
Enabled: true
|
227
231
|
VersionAdded: '0.68'
|
232
|
+
VersionChanged: '0.77'
|
228
233
|
# Alignment of arguments in multi-line method calls.
|
229
234
|
#
|
230
235
|
# The `with_first_argument` style aligns the following lines along the same
|
@@ -246,117 +251,23 @@ Layout/AlignArguments:
|
|
246
251
|
# But it can be overridden by setting this parameter
|
247
252
|
IndentationWidth: ~
|
248
253
|
|
249
|
-
Layout/
|
254
|
+
Layout/ArrayAlignment:
|
250
255
|
Description: >-
|
251
256
|
Align the elements of an array literal if they span more than
|
252
257
|
one line.
|
253
258
|
StyleGuide: '#align-multiline-arrays'
|
254
259
|
Enabled: true
|
255
260
|
VersionAdded: '0.49'
|
261
|
+
VersionChanged: '0.77'
|
256
262
|
|
257
|
-
Layout/
|
258
|
-
Description: >-
|
259
|
-
Align the elements of a hash literal if they span more than
|
260
|
-
one line.
|
261
|
-
Enabled: true
|
262
|
-
AllowMultipleStyles: true
|
263
|
-
VersionAdded: '0.49'
|
264
|
-
# Alignment of entries using hash rocket as separator. Valid values are:
|
265
|
-
#
|
266
|
-
# key - left alignment of keys
|
267
|
-
# 'a' => 2
|
268
|
-
# 'bb' => 3
|
269
|
-
# separator - alignment of hash rockets, keys are right aligned
|
270
|
-
# 'a' => 2
|
271
|
-
# 'bb' => 3
|
272
|
-
# table - left alignment of keys, hash rockets, and values
|
273
|
-
# 'a' => 2
|
274
|
-
# 'bb' => 3
|
275
|
-
EnforcedHashRocketStyle: key
|
276
|
-
SupportedHashRocketStyles:
|
277
|
-
- key
|
278
|
-
- separator
|
279
|
-
- table
|
280
|
-
# Alignment of entries using colon as separator. Valid values are:
|
281
|
-
#
|
282
|
-
# key - left alignment of keys
|
283
|
-
# a: 0
|
284
|
-
# bb: 1
|
285
|
-
# separator - alignment of colons, keys are right aligned
|
286
|
-
# a: 0
|
287
|
-
# bb: 1
|
288
|
-
# table - left alignment of keys and values
|
289
|
-
# a: 0
|
290
|
-
# bb: 1
|
291
|
-
EnforcedColonStyle: key
|
292
|
-
SupportedColonStyles:
|
293
|
-
- key
|
294
|
-
- separator
|
295
|
-
- table
|
296
|
-
# Select whether hashes that are the last argument in a method call should be
|
297
|
-
# inspected? Valid values are:
|
298
|
-
#
|
299
|
-
# always_inspect - Inspect both implicit and explicit hashes.
|
300
|
-
# Registers an offense for:
|
301
|
-
# function(a: 1,
|
302
|
-
# b: 2)
|
303
|
-
# Registers an offense for:
|
304
|
-
# function({a: 1,
|
305
|
-
# b: 2})
|
306
|
-
# always_ignore - Ignore both implicit and explicit hashes.
|
307
|
-
# Accepts:
|
308
|
-
# function(a: 1,
|
309
|
-
# b: 2)
|
310
|
-
# Accepts:
|
311
|
-
# function({a: 1,
|
312
|
-
# b: 2})
|
313
|
-
# ignore_implicit - Ignore only implicit hashes.
|
314
|
-
# Accepts:
|
315
|
-
# function(a: 1,
|
316
|
-
# b: 2)
|
317
|
-
# Registers an offense for:
|
318
|
-
# function({a: 1,
|
319
|
-
# b: 2})
|
320
|
-
# ignore_explicit - Ignore only explicit hashes.
|
321
|
-
# Accepts:
|
322
|
-
# function({a: 1,
|
323
|
-
# b: 2})
|
324
|
-
# Registers an offense for:
|
325
|
-
# function(a: 1,
|
326
|
-
# b: 2)
|
327
|
-
EnforcedLastArgumentHashStyle: always_inspect
|
328
|
-
SupportedLastArgumentHashStyles:
|
329
|
-
- always_inspect
|
330
|
-
- always_ignore
|
331
|
-
- ignore_implicit
|
332
|
-
- ignore_explicit
|
333
|
-
|
334
|
-
Layout/AlignParameters:
|
263
|
+
Layout/AssignmentIndentation:
|
335
264
|
Description: >-
|
336
|
-
|
337
|
-
|
338
|
-
StyleGuide: '#no-double-indent'
|
265
|
+
Checks the indentation of the first line of the
|
266
|
+
right-hand-side of a multi-line assignment.
|
339
267
|
Enabled: true
|
340
268
|
VersionAdded: '0.49'
|
341
|
-
VersionChanged: '0.
|
342
|
-
#
|
343
|
-
#
|
344
|
-
# The `with_first_parameter` style aligns the following lines along the same
|
345
|
-
# column as the first parameter.
|
346
|
-
#
|
347
|
-
# def method_foo(a,
|
348
|
-
# b)
|
349
|
-
#
|
350
|
-
# The `with_fixed_indentation` style aligns the following lines with one
|
351
|
-
# level of indentation relative to the start of the line with the method call.
|
352
|
-
#
|
353
|
-
# def method_foo(a,
|
354
|
-
# b)
|
355
|
-
EnforcedStyle: with_first_parameter
|
356
|
-
SupportedStyles:
|
357
|
-
- with_first_parameter
|
358
|
-
- with_fixed_indentation
|
359
|
-
# By default, the indentation width from Layout/IndentationWidth is used
|
269
|
+
VersionChanged: '0.77'
|
270
|
+
# By default, the indentation width from `Layout/IndentationWidth` is used
|
360
271
|
# But it can be overridden by setting this parameter
|
361
272
|
IndentationWidth: ~
|
362
273
|
|
@@ -624,56 +535,11 @@ Layout/ExtraSpacing:
|
|
624
535
|
# When true, forces the alignment of `=` in assignments on consecutive lines.
|
625
536
|
ForceEqualSignAlignment: false
|
626
537
|
|
627
|
-
Layout/
|
628
|
-
Description: >-
|
629
|
-
Checks for a line break before the first element in a
|
630
|
-
multi-line array.
|
631
|
-
Enabled: false
|
632
|
-
VersionAdded: '0.49'
|
633
|
-
|
634
|
-
Layout/FirstHashElementLineBreak:
|
635
|
-
Description: >-
|
636
|
-
Checks for a line break before the first element in a
|
637
|
-
multi-line hash.
|
638
|
-
Enabled: false
|
639
|
-
VersionAdded: '0.49'
|
640
|
-
|
641
|
-
Layout/FirstMethodArgumentLineBreak:
|
642
|
-
Description: >-
|
643
|
-
Checks for a line break before the first argument in a
|
644
|
-
multi-line method call.
|
645
|
-
Enabled: false
|
646
|
-
VersionAdded: '0.49'
|
647
|
-
|
648
|
-
Layout/FirstMethodParameterLineBreak:
|
649
|
-
Description: >-
|
650
|
-
Checks for a line break before the first parameter in a
|
651
|
-
multi-line method parameter definition.
|
652
|
-
Enabled: false
|
653
|
-
VersionAdded: '0.49'
|
654
|
-
|
655
|
-
Layout/HeredocArgumentClosingParenthesis:
|
656
|
-
Description: >-
|
657
|
-
Checks for the placement of the closing parenthesis in a
|
658
|
-
method call that passes a HEREDOC string as an argument.
|
659
|
-
Enabled: false
|
660
|
-
StyleGuide: '#heredoc-argument-closing-parentheses'
|
661
|
-
VersionAdded: '0.68'
|
662
|
-
|
663
|
-
Layout/IndentAssignment:
|
664
|
-
Description: >-
|
665
|
-
Checks the indentation of the first line of the
|
666
|
-
right-hand-side of a multi-line assignment.
|
667
|
-
Enabled: true
|
668
|
-
VersionAdded: '0.49'
|
669
|
-
# By default, the indentation width from `Layout/IndentationWidth` is used
|
670
|
-
# But it can be overridden by setting this parameter
|
671
|
-
IndentationWidth: ~
|
672
|
-
|
673
|
-
Layout/IndentFirstArgument:
|
538
|
+
Layout/FirstArgumentIndentation:
|
674
539
|
Description: 'Checks the indentation of the first argument in a method call.'
|
675
540
|
Enabled: true
|
676
541
|
VersionAdded: '0.68'
|
542
|
+
VersionChanged: '0.77'
|
677
543
|
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
678
544
|
SupportedStyles:
|
679
545
|
# The first parameter should always be indented one step more than the
|
@@ -694,12 +560,13 @@ Layout/IndentFirstArgument:
|
|
694
560
|
# But it can be overridden by setting this parameter
|
695
561
|
IndentationWidth: ~
|
696
562
|
|
697
|
-
Layout/
|
563
|
+
Layout/FirstArrayElementIndentation:
|
698
564
|
Description: >-
|
699
565
|
Checks the indentation of the first element in an array
|
700
566
|
literal.
|
701
567
|
Enabled: true
|
702
568
|
VersionAdded: '0.68'
|
569
|
+
VersionChanged: '0.77'
|
703
570
|
# The value `special_inside_parentheses` means that array literals with
|
704
571
|
# brackets that have their opening bracket on the same line as a surrounding
|
705
572
|
# opening round parenthesis, shall have their first element indented relative
|
@@ -720,10 +587,18 @@ Layout/IndentFirstArrayElement:
|
|
720
587
|
# But it can be overridden by setting this parameter
|
721
588
|
IndentationWidth: ~
|
722
589
|
|
723
|
-
Layout/
|
590
|
+
Layout/FirstArrayElementLineBreak:
|
591
|
+
Description: >-
|
592
|
+
Checks for a line break before the first element in a
|
593
|
+
multi-line array.
|
594
|
+
Enabled: false
|
595
|
+
VersionAdded: '0.49'
|
596
|
+
|
597
|
+
Layout/FirstHashElementIndentation:
|
724
598
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
725
599
|
Enabled: true
|
726
600
|
VersionAdded: '0.68'
|
601
|
+
VersionChanged: '0.77'
|
727
602
|
# The value `special_inside_parentheses` means that hash literals with braces
|
728
603
|
# that have their opening brace on the same line as a surrounding opening
|
729
604
|
# round parenthesis, shall have their first key indented relative to the
|
@@ -744,13 +619,34 @@ Layout/IndentFirstHashElement:
|
|
744
619
|
# But it can be overridden by setting this parameter
|
745
620
|
IndentationWidth: ~
|
746
621
|
|
747
|
-
Layout/
|
622
|
+
Layout/FirstHashElementLineBreak:
|
623
|
+
Description: >-
|
624
|
+
Checks for a line break before the first element in a
|
625
|
+
multi-line hash.
|
626
|
+
Enabled: false
|
627
|
+
VersionAdded: '0.49'
|
628
|
+
|
629
|
+
Layout/FirstMethodArgumentLineBreak:
|
630
|
+
Description: >-
|
631
|
+
Checks for a line break before the first argument in a
|
632
|
+
multi-line method call.
|
633
|
+
Enabled: false
|
634
|
+
VersionAdded: '0.49'
|
635
|
+
|
636
|
+
Layout/FirstMethodParameterLineBreak:
|
637
|
+
Description: >-
|
638
|
+
Checks for a line break before the first parameter in a
|
639
|
+
multi-line method parameter definition.
|
640
|
+
Enabled: false
|
641
|
+
VersionAdded: '0.49'
|
642
|
+
|
643
|
+
Layout/FirstParameterIndentation:
|
748
644
|
Description: >-
|
749
645
|
Checks the indentation of the first parameter in a
|
750
646
|
method definition.
|
751
647
|
Enabled: true
|
752
648
|
VersionAdded: '0.49'
|
753
|
-
VersionChanged: '0.
|
649
|
+
VersionChanged: '0.77'
|
754
650
|
EnforcedStyle: consistent
|
755
651
|
SupportedStyles:
|
756
652
|
- consistent
|
@@ -759,12 +655,98 @@ Layout/IndentFirstParameter:
|
|
759
655
|
# But it can be overridden by setting this parameter
|
760
656
|
IndentationWidth: ~
|
761
657
|
|
762
|
-
Layout/
|
658
|
+
Layout/HashAlignment:
|
659
|
+
Description: >-
|
660
|
+
Align the elements of a hash literal if they span more than
|
661
|
+
one line.
|
662
|
+
Enabled: true
|
663
|
+
AllowMultipleStyles: true
|
664
|
+
VersionAdded: '0.49'
|
665
|
+
VersionChanged: '0.77'
|
666
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
667
|
+
#
|
668
|
+
# key - left alignment of keys
|
669
|
+
# 'a' => 2
|
670
|
+
# 'bb' => 3
|
671
|
+
# separator - alignment of hash rockets, keys are right aligned
|
672
|
+
# 'a' => 2
|
673
|
+
# 'bb' => 3
|
674
|
+
# table - left alignment of keys, hash rockets, and values
|
675
|
+
# 'a' => 2
|
676
|
+
# 'bb' => 3
|
677
|
+
EnforcedHashRocketStyle: key
|
678
|
+
SupportedHashRocketStyles:
|
679
|
+
- key
|
680
|
+
- separator
|
681
|
+
- table
|
682
|
+
# Alignment of entries using colon as separator. Valid values are:
|
683
|
+
#
|
684
|
+
# key - left alignment of keys
|
685
|
+
# a: 0
|
686
|
+
# bb: 1
|
687
|
+
# separator - alignment of colons, keys are right aligned
|
688
|
+
# a: 0
|
689
|
+
# bb: 1
|
690
|
+
# table - left alignment of keys and values
|
691
|
+
# a: 0
|
692
|
+
# bb: 1
|
693
|
+
EnforcedColonStyle: key
|
694
|
+
SupportedColonStyles:
|
695
|
+
- key
|
696
|
+
- separator
|
697
|
+
- table
|
698
|
+
# Select whether hashes that are the last argument in a method call should be
|
699
|
+
# inspected? Valid values are:
|
700
|
+
#
|
701
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
702
|
+
# Registers an offense for:
|
703
|
+
# function(a: 1,
|
704
|
+
# b: 2)
|
705
|
+
# Registers an offense for:
|
706
|
+
# function({a: 1,
|
707
|
+
# b: 2})
|
708
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
709
|
+
# Accepts:
|
710
|
+
# function(a: 1,
|
711
|
+
# b: 2)
|
712
|
+
# Accepts:
|
713
|
+
# function({a: 1,
|
714
|
+
# b: 2})
|
715
|
+
# ignore_implicit - Ignore only implicit hashes.
|
716
|
+
# Accepts:
|
717
|
+
# function(a: 1,
|
718
|
+
# b: 2)
|
719
|
+
# Registers an offense for:
|
720
|
+
# function({a: 1,
|
721
|
+
# b: 2})
|
722
|
+
# ignore_explicit - Ignore only explicit hashes.
|
723
|
+
# Accepts:
|
724
|
+
# function({a: 1,
|
725
|
+
# b: 2})
|
726
|
+
# Registers an offense for:
|
727
|
+
# function(a: 1,
|
728
|
+
# b: 2)
|
729
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
730
|
+
SupportedLastArgumentHashStyles:
|
731
|
+
- always_inspect
|
732
|
+
- always_ignore
|
733
|
+
- ignore_implicit
|
734
|
+
- ignore_explicit
|
735
|
+
|
736
|
+
Layout/HeredocArgumentClosingParenthesis:
|
737
|
+
Description: >-
|
738
|
+
Checks for the placement of the closing parenthesis in a
|
739
|
+
method call that passes a HEREDOC string as an argument.
|
740
|
+
Enabled: false
|
741
|
+
StyleGuide: '#heredoc-argument-closing-parentheses'
|
742
|
+
VersionAdded: '0.68'
|
743
|
+
|
744
|
+
Layout/HeredocIndentation:
|
763
745
|
Description: 'This cop checks the indentation of the here document bodies.'
|
764
746
|
StyleGuide: '#squiggly-heredocs'
|
765
747
|
Enabled: true
|
766
748
|
VersionAdded: '0.49'
|
767
|
-
VersionChanged: '0.
|
749
|
+
VersionChanged: '0.77'
|
768
750
|
EnforcedStyle: squiggly
|
769
751
|
SupportedStyles:
|
770
752
|
- squiggly
|
@@ -806,11 +788,6 @@ Layout/InitialIndentation:
|
|
806
788
|
Enabled: true
|
807
789
|
VersionAdded: '0.49'
|
808
790
|
|
809
|
-
Layout/LeadingBlankLines:
|
810
|
-
Description: Check for unnecessary blank lines at the beginning of a file.
|
811
|
-
Enabled: true
|
812
|
-
VersionAdded: '0.57'
|
813
|
-
|
814
791
|
Layout/LeadingCommentSpace:
|
815
792
|
Description: 'Comments should start with a space.'
|
816
793
|
StyleGuide: '#hash-space'
|
@@ -818,6 +795,36 @@ Layout/LeadingCommentSpace:
|
|
818
795
|
VersionAdded: '0.49'
|
819
796
|
VersionChanged: '0.73'
|
820
797
|
AllowDoxygenCommentStyle: false
|
798
|
+
AllowGemfileRubyComment: false
|
799
|
+
|
800
|
+
Layout/LeadingEmptyLines:
|
801
|
+
Description: Check for unnecessary blank lines at the beginning of a file.
|
802
|
+
Enabled: true
|
803
|
+
VersionAdded: '0.57'
|
804
|
+
VersionChanged: '0.77'
|
805
|
+
|
806
|
+
Layout/LineLength:
|
807
|
+
Description: 'Limit lines to 80 characters.'
|
808
|
+
StyleGuide: '#80-character-limits'
|
809
|
+
Enabled: true
|
810
|
+
VersionAdded: '0.25'
|
811
|
+
VersionChanged: '0.78'
|
812
|
+
AutoCorrect: false
|
813
|
+
Max: 80
|
814
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
815
|
+
# containing a URI to be longer than Max.
|
816
|
+
AllowHeredoc: true
|
817
|
+
AllowURI: true
|
818
|
+
URISchemes:
|
819
|
+
- http
|
820
|
+
- https
|
821
|
+
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
822
|
+
# directives like '# rubocop: enable ...' when calculating a line's length.
|
823
|
+
IgnoreCopDirectives: true
|
824
|
+
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
825
|
+
# elements. Strings will be converted to Regexp objects. A line that matches
|
826
|
+
# any regular expression listed in this option will be ignored by LineLength.
|
827
|
+
IgnoredPatterns: []
|
821
828
|
|
822
829
|
Layout/MultilineArrayBraceLayout:
|
823
830
|
Description: >-
|
@@ -960,6 +967,35 @@ Layout/MultilineOperationIndentation:
|
|
960
967
|
# But it can be overridden by setting this parameter
|
961
968
|
IndentationWidth: ~
|
962
969
|
|
970
|
+
Layout/ParameterAlignment:
|
971
|
+
Description: >-
|
972
|
+
Align the parameters of a method definition if they span more
|
973
|
+
than one line.
|
974
|
+
StyleGuide: '#no-double-indent'
|
975
|
+
Enabled: true
|
976
|
+
VersionAdded: '0.49'
|
977
|
+
VersionChanged: '0.77'
|
978
|
+
# Alignment of parameters in multi-line method calls.
|
979
|
+
#
|
980
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
981
|
+
# column as the first parameter.
|
982
|
+
#
|
983
|
+
# def method_foo(a,
|
984
|
+
# b)
|
985
|
+
#
|
986
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
987
|
+
# level of indentation relative to the start of the line with the method call.
|
988
|
+
#
|
989
|
+
# def method_foo(a,
|
990
|
+
# b)
|
991
|
+
EnforcedStyle: with_first_parameter
|
992
|
+
SupportedStyles:
|
993
|
+
- with_first_parameter
|
994
|
+
- with_fixed_indentation
|
995
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
996
|
+
# But it can be overridden by setting this parameter
|
997
|
+
IndentationWidth: ~
|
998
|
+
|
963
999
|
Layout/RescueEnsureAlignment:
|
964
1000
|
Description: 'Align rescues and ensures correctly.'
|
965
1001
|
Enabled: true
|
@@ -1033,6 +1069,10 @@ Layout/SpaceAroundOperators:
|
|
1033
1069
|
# with an operator on the previous or next line, not counting empty lines
|
1034
1070
|
# or comment lines.
|
1035
1071
|
AllowForAlignment: true
|
1072
|
+
EnforcedStyleForExponentOperator: no_space
|
1073
|
+
SupportedStylesForExponentOperator:
|
1074
|
+
- space
|
1075
|
+
- no_space
|
1036
1076
|
|
1037
1077
|
Layout/SpaceBeforeBlockBraces:
|
1038
1078
|
Description: >-
|
@@ -1202,11 +1242,12 @@ Layout/Tab:
|
|
1202
1242
|
# replace each tab.
|
1203
1243
|
IndentationWidth: ~
|
1204
1244
|
|
1205
|
-
Layout/
|
1245
|
+
Layout/TrailingEmptyLines:
|
1206
1246
|
Description: 'Checks trailing blank lines and final newline.'
|
1207
1247
|
StyleGuide: '#newline-eof'
|
1208
1248
|
Enabled: true
|
1209
1249
|
VersionAdded: '0.49'
|
1250
|
+
VersionChanged: '0.77'
|
1210
1251
|
EnforcedStyle: final_newline
|
1211
1252
|
SupportedStyles:
|
1212
1253
|
- final_newline
|
@@ -1290,16 +1331,17 @@ Lint/DuplicateCaseCondition:
|
|
1290
1331
|
Enabled: true
|
1291
1332
|
VersionAdded: '0.45'
|
1292
1333
|
|
1334
|
+
Lint/DuplicateHashKey:
|
1335
|
+
Description: 'Check for duplicate keys in hash literals.'
|
1336
|
+
Enabled: true
|
1337
|
+
VersionAdded: '0.34'
|
1338
|
+
VersionChanged: '0.77'
|
1339
|
+
|
1293
1340
|
Lint/DuplicateMethods:
|
1294
1341
|
Description: 'Check for duplicate method definitions.'
|
1295
1342
|
Enabled: true
|
1296
1343
|
VersionAdded: '0.29'
|
1297
1344
|
|
1298
|
-
Lint/DuplicatedKey:
|
1299
|
-
Description: 'Check for duplicate keys in hash literals.'
|
1300
|
-
Enabled: true
|
1301
|
-
VersionAdded: '0.34'
|
1302
|
-
|
1303
1345
|
Lint/EachWithObjectArgument:
|
1304
1346
|
Description: 'Check for immutable argument given to each_with_object.'
|
1305
1347
|
Enabled: true
|
@@ -1367,14 +1409,6 @@ Lint/FormatParameterMismatch:
|
|
1367
1409
|
Enabled: true
|
1368
1410
|
VersionAdded: '0.33'
|
1369
1411
|
|
1370
|
-
Lint/HandleExceptions:
|
1371
|
-
Description: "Don't suppress exception."
|
1372
|
-
StyleGuide: '#dont-hide-exceptions'
|
1373
|
-
Enabled: true
|
1374
|
-
AllowComments: false
|
1375
|
-
VersionAdded: '0.9'
|
1376
|
-
VersionChanged: '0.70'
|
1377
|
-
|
1378
1412
|
Lint/HeredocMethodCallPosition:
|
1379
1413
|
Description: >-
|
1380
1414
|
Checks for the ordering of a method call where
|
@@ -1444,10 +1478,11 @@ Lint/MissingCopEnableDirective:
|
|
1444
1478
|
# .inf for any size
|
1445
1479
|
MaximumRangeSize: .inf
|
1446
1480
|
|
1447
|
-
Lint/
|
1448
|
-
Description: "Use `&&` operator to compare multiple
|
1481
|
+
Lint/MultipleComparison:
|
1482
|
+
Description: "Use `&&` operator to compare multiple values."
|
1449
1483
|
Enabled: true
|
1450
1484
|
VersionAdded: '0.47'
|
1485
|
+
VersionChanged: '0.77'
|
1451
1486
|
|
1452
1487
|
Lint/NestedMethodDefinition:
|
1453
1488
|
Description: 'Do not use nested method definitions.'
|
@@ -1467,6 +1502,12 @@ Lint/NextWithoutAccumulator:
|
|
1467
1502
|
Enabled: true
|
1468
1503
|
VersionAdded: '0.36'
|
1469
1504
|
|
1505
|
+
Lint/NonDeterministicRequireOrder:
|
1506
|
+
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1507
|
+
Enabled: true
|
1508
|
+
VersionAdded: '0.78'
|
1509
|
+
Safe: false
|
1510
|
+
|
1470
1511
|
Lint/NonLocalExitFromIterator:
|
1471
1512
|
Description: 'Do not use return in iterator to cause non-local exit.'
|
1472
1513
|
Enabled: true
|
@@ -1535,6 +1576,13 @@ Lint/RedundantSplatExpansion:
|
|
1535
1576
|
Enabled: true
|
1536
1577
|
VersionChanged: '0.76'
|
1537
1578
|
|
1579
|
+
Lint/RedundantStringCoercion:
|
1580
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
1581
|
+
StyleGuide: '#no-to-s'
|
1582
|
+
Enabled: true
|
1583
|
+
VersionAdded: '0.19'
|
1584
|
+
VersionChanged: '0.77'
|
1585
|
+
|
1538
1586
|
Lint/RedundantWithIndex:
|
1539
1587
|
Description: 'Checks for redundant `with_index`.'
|
1540
1588
|
Enabled: true
|
@@ -1580,8 +1628,8 @@ Lint/SafeNavigationChain:
|
|
1580
1628
|
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
1581
1629
|
Enabled: true
|
1582
1630
|
VersionAdded: '0.47'
|
1583
|
-
VersionChanged: '0.
|
1584
|
-
|
1631
|
+
VersionChanged: '0.77'
|
1632
|
+
AllowedMethods:
|
1585
1633
|
- present?
|
1586
1634
|
- blank?
|
1587
1635
|
- presence
|
@@ -1595,14 +1643,14 @@ Lint/SafeNavigationConsistency:
|
|
1595
1643
|
for all method calls on that same object.
|
1596
1644
|
Enabled: true
|
1597
1645
|
VersionAdded: '0.55'
|
1598
|
-
|
1646
|
+
VersionChanged: '0.77'
|
1647
|
+
AllowedMethods:
|
1599
1648
|
- present?
|
1600
1649
|
- blank?
|
1601
1650
|
- presence
|
1602
1651
|
- try
|
1603
1652
|
- try!
|
1604
1653
|
|
1605
|
-
|
1606
1654
|
Lint/SafeNavigationWithEmpty:
|
1607
1655
|
Description: 'Avoid `foo&.empty?` in conditionals.'
|
1608
1656
|
Enabled: true
|
@@ -1640,12 +1688,13 @@ Lint/ShadowingOuterLocalVariable:
|
|
1640
1688
|
Enabled: true
|
1641
1689
|
VersionAdded: '0.9'
|
1642
1690
|
|
1643
|
-
Lint/
|
1644
|
-
Description: '
|
1645
|
-
StyleGuide: '#
|
1691
|
+
Lint/SuppressedException:
|
1692
|
+
Description: "Don't suppress exceptions."
|
1693
|
+
StyleGuide: '#dont-hide-exceptions'
|
1646
1694
|
Enabled: true
|
1647
|
-
|
1648
|
-
|
1695
|
+
AllowComments: false
|
1696
|
+
VersionAdded: '0.9'
|
1697
|
+
VersionChanged: '0.77'
|
1649
1698
|
|
1650
1699
|
Lint/Syntax:
|
1651
1700
|
Description: 'Checks syntax error.'
|
@@ -1735,6 +1784,8 @@ Lint/UselessSetterCall:
|
|
1735
1784
|
Description: 'Checks for useless setter call to a local variable.'
|
1736
1785
|
Enabled: true
|
1737
1786
|
VersionAdded: '0.13'
|
1787
|
+
VersionChanged: '0.80'
|
1788
|
+
Safe: false
|
1738
1789
|
|
1739
1790
|
Lint/Void:
|
1740
1791
|
Description: 'Possible use of operator/literal/variable in void context.'
|
@@ -1797,29 +1848,6 @@ Metrics/CyclomaticComplexity:
|
|
1797
1848
|
VersionAdded: '0.25'
|
1798
1849
|
Max: 6
|
1799
1850
|
|
1800
|
-
Metrics/LineLength:
|
1801
|
-
Description: 'Limit lines to 80 characters.'
|
1802
|
-
StyleGuide: '#80-character-limits'
|
1803
|
-
Enabled: true
|
1804
|
-
VersionAdded: '0.25'
|
1805
|
-
VersionChanged: '0.68'
|
1806
|
-
AutoCorrect: false
|
1807
|
-
Max: 80
|
1808
|
-
# To make it possible to copy or click on URIs in the code, we allow lines
|
1809
|
-
# containing a URI to be longer than Max.
|
1810
|
-
AllowHeredoc: true
|
1811
|
-
AllowURI: true
|
1812
|
-
URISchemes:
|
1813
|
-
- http
|
1814
|
-
- https
|
1815
|
-
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
1816
|
-
# directives like '# rubocop: enable ...' when calculating a line's length.
|
1817
|
-
IgnoreCopDirectives: true
|
1818
|
-
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
1819
|
-
# elements. Strings will be converted to Regexp objects. A line that matches
|
1820
|
-
# any regular expression listed in this option will be ignored by LineLength.
|
1821
|
-
IgnoredPatterns: []
|
1822
|
-
|
1823
1851
|
Metrics/MethodLength:
|
1824
1852
|
Description: 'Avoid methods longer than 10 lines of code.'
|
1825
1853
|
StyleGuide: '#short-methods'
|
@@ -1859,7 +1887,7 @@ Migration/DepartmentName:
|
|
1859
1887
|
Description: >-
|
1860
1888
|
Check that cop names in rubocop:disable (etc) comments are
|
1861
1889
|
given with department name.
|
1862
|
-
Enabled:
|
1890
|
+
Enabled: true
|
1863
1891
|
|
1864
1892
|
#################### Naming ##############################
|
1865
1893
|
|
@@ -1881,6 +1909,21 @@ Naming/BinaryOperatorParameterName:
|
|
1881
1909
|
Enabled: true
|
1882
1910
|
VersionAdded: '0.50'
|
1883
1911
|
|
1912
|
+
Naming/BlockParameterName:
|
1913
|
+
Description: >-
|
1914
|
+
Checks for block parameter names that contain capital letters,
|
1915
|
+
end in numbers, or do not meet a minimal length.
|
1916
|
+
Enabled: true
|
1917
|
+
VersionAdded: '0.53'
|
1918
|
+
VersionChanged: '0.77'
|
1919
|
+
# Parameter names may be equal to or greater than this value
|
1920
|
+
MinNameLength: 1
|
1921
|
+
AllowNamesEndingInNumbers: true
|
1922
|
+
# Allowed names that will not register an offense
|
1923
|
+
AllowedNames: []
|
1924
|
+
# Forbidden names that will register an offense
|
1925
|
+
ForbiddenNames: []
|
1926
|
+
|
1884
1927
|
Naming/ClassAndModuleCamelCase:
|
1885
1928
|
Description: 'Use CamelCase for classes and modules.'
|
1886
1929
|
StyleGuide: '#camelcase-classes'
|
@@ -1972,7 +2015,7 @@ Naming/HeredocDelimiterNaming:
|
|
1972
2015
|
StyleGuide: '#heredoc-delimiters'
|
1973
2016
|
Enabled: true
|
1974
2017
|
VersionAdded: '0.50'
|
1975
|
-
|
2018
|
+
ForbiddenDelimiters:
|
1976
2019
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
1977
2020
|
|
1978
2021
|
Naming/MemoizedInstanceVariableName:
|
@@ -2004,25 +2047,51 @@ Naming/MethodName:
|
|
2004
2047
|
#
|
2005
2048
|
IgnoredPatterns: []
|
2006
2049
|
|
2050
|
+
Naming/MethodParameterName:
|
2051
|
+
Description: >-
|
2052
|
+
Checks for method parameter names that contain capital letters,
|
2053
|
+
end in numbers, or do not meet a minimal length.
|
2054
|
+
Enabled: true
|
2055
|
+
VersionAdded: '0.53'
|
2056
|
+
VersionChanged: '0.77'
|
2057
|
+
# Parameter names may be equal to or greater than this value
|
2058
|
+
MinNameLength: 3
|
2059
|
+
AllowNamesEndingInNumbers: true
|
2060
|
+
# Allowed names that will not register an offense
|
2061
|
+
AllowedNames:
|
2062
|
+
- io
|
2063
|
+
- id
|
2064
|
+
- to
|
2065
|
+
- by
|
2066
|
+
- 'on'
|
2067
|
+
- in
|
2068
|
+
- at
|
2069
|
+
- ip
|
2070
|
+
- db
|
2071
|
+
- os
|
2072
|
+
- pp
|
2073
|
+
# Forbidden names that will register an offense
|
2074
|
+
ForbiddenNames: []
|
2075
|
+
|
2007
2076
|
Naming/PredicateName:
|
2008
2077
|
Description: 'Check the names of predicate methods.'
|
2009
2078
|
StyleGuide: '#bool-methods-qmark'
|
2010
2079
|
Enabled: true
|
2011
2080
|
VersionAdded: '0.50'
|
2012
|
-
VersionChanged: '0.
|
2081
|
+
VersionChanged: '0.77'
|
2013
2082
|
# Predicate name prefixes.
|
2014
2083
|
NamePrefix:
|
2015
2084
|
- is_
|
2016
2085
|
- has_
|
2017
2086
|
- have_
|
2018
2087
|
# Predicate name prefixes that should be removed.
|
2019
|
-
|
2088
|
+
ForbiddenPrefixes:
|
2020
2089
|
- is_
|
2021
2090
|
- has_
|
2022
2091
|
- have_
|
2023
|
-
# Predicate names which, despite having a
|
2092
|
+
# Predicate names which, despite having a forbidden prefix, or no `?`,
|
2024
2093
|
# should still be accepted
|
2025
|
-
|
2094
|
+
AllowedMethods:
|
2026
2095
|
- is_a?
|
2027
2096
|
# Method definition macros for dynamically generated methods.
|
2028
2097
|
MethodDefinitionMacros:
|
@@ -2040,46 +2109,6 @@ Naming/RescuedExceptionsVariableName:
|
|
2040
2109
|
VersionChanged: '0.68'
|
2041
2110
|
PreferredName: e
|
2042
2111
|
|
2043
|
-
Naming/UncommunicativeBlockParamName:
|
2044
|
-
Description: >-
|
2045
|
-
Checks for block parameter names that contain capital letters,
|
2046
|
-
end in numbers, or do not meet a minimal length.
|
2047
|
-
Enabled: true
|
2048
|
-
VersionAdded: '0.53'
|
2049
|
-
# Parameter names may be equal to or greater than this value
|
2050
|
-
MinNameLength: 1
|
2051
|
-
AllowNamesEndingInNumbers: true
|
2052
|
-
# Whitelisted names that will not register an offense
|
2053
|
-
AllowedNames: []
|
2054
|
-
# Blacklisted names that will register an offense
|
2055
|
-
ForbiddenNames: []
|
2056
|
-
|
2057
|
-
Naming/UncommunicativeMethodParamName:
|
2058
|
-
Description: >-
|
2059
|
-
Checks for method parameter names that contain capital letters,
|
2060
|
-
end in numbers, or do not meet a minimal length.
|
2061
|
-
Enabled: true
|
2062
|
-
VersionAdded: '0.53'
|
2063
|
-
VersionChanged: '0.59'
|
2064
|
-
# Parameter names may be equal to or greater than this value
|
2065
|
-
MinNameLength: 3
|
2066
|
-
AllowNamesEndingInNumbers: true
|
2067
|
-
# Whitelisted names that will not register an offense
|
2068
|
-
AllowedNames:
|
2069
|
-
- io
|
2070
|
-
- id
|
2071
|
-
- to
|
2072
|
-
- by
|
2073
|
-
- 'on'
|
2074
|
-
- in
|
2075
|
-
- at
|
2076
|
-
- ip
|
2077
|
-
- db
|
2078
|
-
- os
|
2079
|
-
# Blacklisted names that will register an offense
|
2080
|
-
ForbiddenNames: []
|
2081
|
-
|
2082
|
-
|
2083
2112
|
Naming/VariableName:
|
2084
2113
|
Description: 'Use the configured style when naming variables.'
|
2085
2114
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
@@ -2331,24 +2360,12 @@ Style/BlockDelimiters:
|
|
2331
2360
|
# # also good
|
2332
2361
|
# collection.each do |element| puts element end
|
2333
2362
|
AllowBracesOnProceduralOneLiners: false
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
EnforcedStyle: no_braces
|
2341
|
-
SupportedStyles:
|
2342
|
-
# The `braces` style enforces braces around all method parameters that are
|
2343
|
-
# hashes.
|
2344
|
-
- braces
|
2345
|
-
# The `no_braces` style checks that the last parameter doesn't have braces
|
2346
|
-
# around it.
|
2347
|
-
- no_braces
|
2348
|
-
# The `context_dependent` style checks that the last parameter doesn't have
|
2349
|
-
# braces around it, but requires braces if the second to last parameter is
|
2350
|
-
# also a hash literal.
|
2351
|
-
- context_dependent
|
2363
|
+
# The BracesRequiredMethods overrides all other configurations except
|
2364
|
+
# IgnoredMethods. It can be used to enforce that all blocks for specific
|
2365
|
+
# methods use braces. For example, you can use this to enforce Sorbet
|
2366
|
+
# signatures use braces even when the rest of your codebase enforces
|
2367
|
+
# the `line_count_based` style.
|
2368
|
+
BracesRequiredMethods: []
|
2352
2369
|
|
2353
2370
|
Style/CaseEquality:
|
2354
2371
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
@@ -2734,7 +2751,7 @@ Style/FrozenStringLiteralComment:
|
|
2734
2751
|
to help transition to frozen string literals by default.
|
2735
2752
|
Enabled: true
|
2736
2753
|
VersionAdded: '0.36'
|
2737
|
-
VersionChanged: '0.
|
2754
|
+
VersionChanged: '0.79'
|
2738
2755
|
EnforcedStyle: always
|
2739
2756
|
SupportedStyles:
|
2740
2757
|
# `always` will always add the frozen string literal comment to a file
|
@@ -2742,9 +2759,14 @@ Style/FrozenStringLiteralComment:
|
|
2742
2759
|
# string literal. If you run code against multiple versions of Ruby, it is
|
2743
2760
|
# possible that this will create errors in Ruby 2.3.0+.
|
2744
2761
|
- always
|
2762
|
+
# `always_true` will add the frozen string literal comment to a file,
|
2763
|
+
# similarly to the `always` style, but will also change any disabled
|
2764
|
+
# comments (e.g. `# frozen_string_literal: false`) to be enabled.
|
2765
|
+
- always_true
|
2745
2766
|
# `never` will enforce that the frozen string literal comment does not
|
2746
2767
|
# exist in a file.
|
2747
2768
|
- never
|
2769
|
+
Safe: false
|
2748
2770
|
|
2749
2771
|
Style/GlobalVars:
|
2750
2772
|
Description: 'Do not introduce global variables.'
|
@@ -2765,6 +2787,13 @@ Style/GuardClause:
|
|
2765
2787
|
# needs to have to trigger this cop
|
2766
2788
|
MinBodyLength: 1
|
2767
2789
|
|
2790
|
+
Style/HashEachMethods:
|
2791
|
+
Description: 'Use Hash#each_key and Hash#each_value.'
|
2792
|
+
StyleGuide: '#hash-each'
|
2793
|
+
Enabled: pending
|
2794
|
+
VersionAdded: '0.80'
|
2795
|
+
Safe: false
|
2796
|
+
|
2768
2797
|
Style/HashSyntax:
|
2769
2798
|
Description: >-
|
2770
2799
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
@@ -2788,6 +2817,18 @@ Style/HashSyntax:
|
|
2788
2817
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
2789
2818
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
2790
2819
|
|
2820
|
+
Style/HashTransformKeys:
|
2821
|
+
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
2822
|
+
Enabled: 'pending'
|
2823
|
+
VersionAdded: '0.80'
|
2824
|
+
Safe: false
|
2825
|
+
|
2826
|
+
Style/HashTransformValues:
|
2827
|
+
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
2828
|
+
Enabled: 'pending'
|
2829
|
+
VersionAdded: '0.80'
|
2830
|
+
Safe: false
|
2831
|
+
|
2791
2832
|
Style/IdenticalConditionalBranches:
|
2792
2833
|
Description: >-
|
2793
2834
|
Checks that conditional statements do not have an identical
|
@@ -2874,8 +2915,9 @@ Style/IpAddresses:
|
|
2874
2915
|
Description: "Don't include literal IP addresses in code."
|
2875
2916
|
Enabled: false
|
2876
2917
|
VersionAdded: '0.58'
|
2877
|
-
|
2878
|
-
|
2918
|
+
VersionChanged: '0.77'
|
2919
|
+
# Allow addresses to be permitted
|
2920
|
+
AllowedAddresses:
|
2879
2921
|
- "::"
|
2880
2922
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
2881
2923
|
|
@@ -3148,8 +3190,8 @@ Style/NestedParenthesizedCalls:
|
|
3148
3190
|
argument list of another parenthesized method call.
|
3149
3191
|
Enabled: true
|
3150
3192
|
VersionAdded: '0.36'
|
3151
|
-
VersionChanged: '0.
|
3152
|
-
|
3193
|
+
VersionChanged: '0.77'
|
3194
|
+
AllowedMethods:
|
3153
3195
|
- be
|
3154
3196
|
- be_a
|
3155
3197
|
- be_an
|
@@ -3526,11 +3568,11 @@ Style/SafeNavigation:
|
|
3526
3568
|
safe navigation (`&.`).
|
3527
3569
|
Enabled: true
|
3528
3570
|
VersionAdded: '0.43'
|
3529
|
-
VersionChanged: '0.
|
3571
|
+
VersionChanged: '0.77'
|
3530
3572
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
3531
3573
|
# to whatever it used to return.
|
3532
3574
|
ConvertCodeThatCanStartToReturnNil: false
|
3533
|
-
|
3575
|
+
AllowedMethods:
|
3534
3576
|
- present?
|
3535
3577
|
- blank?
|
3536
3578
|
- presence
|
@@ -3808,7 +3850,7 @@ Style/TrivialAccessors:
|
|
3808
3850
|
StyleGuide: '#attr_family'
|
3809
3851
|
Enabled: true
|
3810
3852
|
VersionAdded: '0.9'
|
3811
|
-
VersionChanged: '0.
|
3853
|
+
VersionChanged: '0.77'
|
3812
3854
|
# When set to `false` the cop will suggest the use of accessor methods
|
3813
3855
|
# in situations like:
|
3814
3856
|
#
|
@@ -3829,7 +3871,7 @@ Style/TrivialAccessors:
|
|
3829
3871
|
# Commonly used in DSLs
|
3830
3872
|
AllowDSLWriters: false
|
3831
3873
|
IgnoreClassMethods: false
|
3832
|
-
|
3874
|
+
AllowedMethods:
|
3833
3875
|
- to_ary
|
3834
3876
|
- to_a
|
3835
3877
|
- to_c
|