rubocop 0.79.0 → 0.83.0
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 +5 -5
- data/config/default.yml +184 -50
- data/lib/rubocop.rb +15 -5
- data/lib/rubocop/ast/builder.rb +2 -0
- data/lib/rubocop/ast/node.rb +12 -19
- data/lib/rubocop/ast/node/array_node.rb +13 -0
- data/lib/rubocop/ast/node/block_node.rb +5 -1
- data/lib/rubocop/ast/node/case_match_node.rb +56 -0
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +8 -0
- data/lib/rubocop/ast/node/regexp_node.rb +2 -4
- data/lib/rubocop/ast/node/send_node.rb +4 -0
- data/lib/rubocop/ast/traversal.rb +20 -9
- data/lib/rubocop/cli.rb +11 -5
- data/lib/rubocop/comment_config.rb +6 -1
- data/lib/rubocop/config.rb +40 -10
- data/lib/rubocop/config_loader.rb +43 -33
- data/lib/rubocop/config_loader_resolver.rb +28 -1
- data/lib/rubocop/config_obsoletion.rb +4 -1
- data/lib/rubocop/config_validator.rb +18 -1
- data/lib/rubocop/cop/badge.rb +5 -5
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +1 -1
- data/lib/rubocop/cop/corrector.rb +48 -24
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +2 -2
- data/lib/rubocop/cop/correctors/condition_corrector.rb +1 -2
- data/lib/rubocop/cop/correctors/empty_line_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +3 -3
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +2 -2
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/string_literal_corrector.rb +2 -2
- data/lib/rubocop/cop/generator.rb +3 -2
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +1 -1
- data/lib/rubocop/cop/layout/array_alignment.rb +53 -10
- data/lib/rubocop/cop/layout/block_end_newline.rb +5 -3
- data/lib/rubocop/cop/layout/condition_position.rb +12 -2
- data/lib/rubocop/cop/layout/dot_position.rb +1 -1
- data/lib/rubocop/cop/layout/else_alignment.rb +8 -0
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +2 -1
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +68 -0
- data/lib/rubocop/cop/layout/end_of_line.rb +2 -2
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +16 -10
- data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +2 -2
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/{tab.rb → indentation_style.rb} +48 -6
- data/lib/rubocop/cop/layout/leading_comment_space.rb +34 -3
- data/lib/rubocop/cop/layout/line_length.rb +36 -4
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +0 -4
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +13 -4
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +3 -3
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +133 -0
- data/lib/rubocop/cop/layout/space_around_operators.rb +37 -2
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +8 -0
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +2 -2
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +2 -9
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +2 -2
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +2 -2
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +38 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +14 -0
- data/lib/rubocop/cop/lint/boolean_symbol.rb +12 -0
- data/lib/rubocop/cop/lint/debugger.rb +2 -2
- data/lib/rubocop/cop/lint/duplicate_methods.rb +1 -5
- data/lib/rubocop/cop/lint/empty_when.rb +29 -6
- data/lib/rubocop/cop/lint/ensure_return.rb +18 -1
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +1 -1
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +1 -1
- data/lib/rubocop/cop/lint/inherit_exception.rb +1 -1
- data/lib/rubocop/cop/lint/interpolation_check.rb +1 -1
- data/lib/rubocop/cop/lint/literal_as_condition.rb +10 -13
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/loop.rb +6 -4
- data/lib/rubocop/cop/lint/multiple_comparison.rb +1 -1
- data/lib/rubocop/cop/lint/nested_method_definition.rb +2 -2
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +2 -2
- data/lib/rubocop/cop/lint/number_conversion.rb +1 -1
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +21 -9
- data/lib/rubocop/cop/lint/percent_string_array.rb +2 -2
- data/lib/rubocop/cop/lint/raise_exception.rb +75 -0
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +1 -6
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +12 -7
- data/lib/rubocop/cop/lint/redundant_string_coercion.rb +1 -1
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +1 -1
- data/lib/rubocop/cop/lint/struct_new_override.rb +58 -0
- data/lib/rubocop/cop/lint/suppressed_exception.rb +12 -28
- data/lib/rubocop/cop/lint/unified_integer.rb +0 -2
- data/lib/rubocop/cop/lint/unused_method_argument.rb +32 -6
- data/lib/rubocop/cop/lint/uri_regexp.rb +4 -4
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +12 -0
- data/lib/rubocop/cop/lint/useless_assignment.rb +3 -2
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +5 -0
- data/lib/rubocop/cop/lint/useless_setter_call.rb +4 -0
- data/lib/rubocop/cop/migration/department_name.rb +36 -10
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +4 -0
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +6 -1
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +16 -1
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +178 -0
- data/lib/rubocop/cop/mixin/line_length_help.rb +2 -1
- data/lib/rubocop/cop/mixin/method_complexity.rb +5 -0
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -1
- data/lib/rubocop/cop/mixin/statement_modifier.rb +7 -22
- data/lib/rubocop/cop/mixin/target_ruby_version.rb +5 -1
- data/lib/rubocop/cop/mixin/trailing_comma.rb +3 -10
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +1 -1
- data/lib/rubocop/cop/naming/constant_name.rb +2 -1
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +1 -1
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +1 -1
- data/lib/rubocop/cop/naming/method_name.rb +26 -0
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +1 -1
- data/lib/rubocop/cop/registry.rb +11 -4
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +26 -6
- data/lib/rubocop/cop/style/alias.rb +4 -4
- data/lib/rubocop/cop/style/and_or.rb +5 -6
- data/lib/rubocop/cop/style/array_join.rb +1 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +60 -1
- data/lib/rubocop/cop/style/case_equality.rb +24 -1
- data/lib/rubocop/cop/style/character_literal.rb +2 -2
- data/lib/rubocop/cop/style/collection_methods.rb +2 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +8 -8
- data/lib/rubocop/cop/style/copyright.rb +1 -1
- data/lib/rubocop/cop/style/dir.rb +1 -1
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +49 -0
- data/lib/rubocop/cop/style/documentation.rb +43 -5
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +1 -1
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +1 -1
- data/lib/rubocop/cop/style/each_with_object.rb +3 -3
- data/lib/rubocop/cop/style/empty_method.rb +1 -5
- data/lib/rubocop/cop/style/end_block.rb +6 -0
- data/lib/rubocop/cop/style/even_odd.rb +1 -1
- data/lib/rubocop/cop/style/expand_path_arguments.rb +3 -3
- data/lib/rubocop/cop/style/exponential_notation.rb +119 -0
- data/lib/rubocop/cop/style/format_string.rb +2 -2
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +89 -11
- data/lib/rubocop/cop/style/guard_clause.rb +25 -2
- data/lib/rubocop/cop/style/hash_each_methods.rb +89 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +3 -5
- data/lib/rubocop/cop/style/hash_transform_keys.rb +83 -0
- data/lib/rubocop/cop/style/hash_transform_values.rb +80 -0
- data/lib/rubocop/cop/style/if_unless_modifier.rb +23 -3
- data/lib/rubocop/cop/style/if_with_semicolon.rb +16 -0
- data/lib/rubocop/cop/style/inverse_methods.rb +9 -5
- data/lib/rubocop/cop/style/lambda.rb +3 -2
- data/lib/rubocop/cop/style/lambda_call.rb +1 -21
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +5 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +5 -4
- data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
- data/lib/rubocop/cop/style/module_function.rb +58 -12
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +1 -1
- data/lib/rubocop/cop/style/multiline_memoization.rb +1 -1
- data/lib/rubocop/cop/style/multiline_when_then.rb +16 -1
- data/lib/rubocop/cop/style/mutable_constant.rb +2 -4
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +4 -4
- data/lib/rubocop/cop/style/next.rb +2 -2
- data/lib/rubocop/cop/style/nil_comparison.rb +1 -1
- data/lib/rubocop/cop/style/non_nil_check.rb +4 -4
- data/lib/rubocop/cop/style/not.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literals.rb +1 -1
- data/lib/rubocop/cop/style/numeric_predicate.rb +1 -1
- data/lib/rubocop/cop/style/one_line_conditional.rb +4 -3
- data/lib/rubocop/cop/style/optional_arguments.rb +1 -1
- data/lib/rubocop/cop/style/or_assignment.rb +4 -3
- data/lib/rubocop/cop/style/percent_q_literals.rb +1 -1
- data/lib/rubocop/cop/style/perl_backrefs.rb +2 -2
- data/lib/rubocop/cop/style/proc.rb +1 -1
- data/lib/rubocop/cop/style/raise_args.rb +1 -1
- data/lib/rubocop/cop/style/random_with_offset.rb +3 -3
- data/lib/rubocop/cop/style/redundant_condition.rb +18 -6
- data/lib/rubocop/cop/style/redundant_conditional.rb +1 -1
- data/lib/rubocop/cop/style/redundant_exception.rb +3 -3
- data/lib/rubocop/cop/style/redundant_interpolation.rb +2 -2
- data/lib/rubocop/cop/style/redundant_percent_q.rb +2 -2
- data/lib/rubocop/cop/style/redundant_return.rb +5 -7
- data/lib/rubocop/cop/style/redundant_self.rb +1 -1
- data/lib/rubocop/cop/style/redundant_sort.rb +2 -2
- data/lib/rubocop/cop/style/rescue_modifier.rb +1 -1
- data/lib/rubocop/cop/style/return_nil.rb +1 -1
- data/lib/rubocop/cop/style/safe_navigation.rb +1 -1
- data/lib/rubocop/cop/style/self_assignment.rb +1 -1
- data/lib/rubocop/cop/style/slicing_with_range.rb +39 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +1 -1
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +1 -4
- data/lib/rubocop/cop/style/string_hash_keys.rb +1 -1
- data/lib/rubocop/cop/style/symbol_array.rb +3 -3
- data/lib/rubocop/cop/style/symbol_literal.rb +2 -2
- data/lib/rubocop/cop/style/ternary_parentheses.rb +2 -3
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +35 -22
- data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +41 -0
- data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +88 -0
- data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +44 -0
- data/lib/rubocop/cop/style/trivial_accessors.rb +1 -1
- data/lib/rubocop/cop/style/unpack_first.rb +0 -4
- data/lib/rubocop/cop/style/variable_interpolation.rb +1 -1
- data/lib/rubocop/cop/style/while_until_modifier.rb +1 -1
- data/lib/rubocop/cop/style/word_array.rb +1 -1
- data/lib/rubocop/cop/style/zero_length_predicate.rb +1 -1
- data/lib/rubocop/cop/util.rb +24 -0
- data/lib/rubocop/cop/variable_force.rb +4 -1
- data/lib/rubocop/cop/variable_force/assignment.rb +1 -0
- data/lib/rubocop/cop/variable_force/scope.rb +1 -0
- data/lib/rubocop/cop/variable_force/variable.rb +1 -0
- data/lib/rubocop/formatter/clang_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/formatter_set.rb +1 -1
- data/lib/rubocop/formatter/junit_formatter.rb +74 -0
- data/lib/rubocop/formatter/pacman_formatter.rb +1 -1
- data/lib/rubocop/formatter/tap_formatter.rb +1 -1
- data/lib/rubocop/name_similarity.rb +12 -9
- data/lib/rubocop/node_pattern.rb +96 -10
- data/lib/rubocop/options.rb +18 -5
- data/lib/rubocop/processed_source.rb +1 -4
- data/lib/rubocop/rspec/cop_helper.rb +1 -1
- data/lib/rubocop/rspec/expect_offense.rb +1 -1
- data/lib/rubocop/rspec/shared_contexts.rb +0 -4
- data/lib/rubocop/runner.rb +7 -2
- data/lib/rubocop/target_finder.rb +6 -4
- data/lib/rubocop/target_ruby.rb +2 -2
- data/lib/rubocop/version.rb +1 -1
- metadata +35 -25
- data/lib/rubocop/cop/lint/end_in_method.rb +0 -40
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +0 -209
- data/lib/rubocop/formatter/disabled_lines_formatter.rb +0 -57
- data/lib/rubocop/string_util.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02ede8c9af1fb47b66ac79a0d93d577a5384f82f5076e1e64631ca761c4d3f6b
|
4
|
+
data.tar.gz: 2f22e7716a7068013b131636217a77189f2ca506e53c8613c407c18f8028600e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 936fdee12ea43542b66ab1cccc0514f1a7076dbd671386cccf376e61633b12e51c88feba3e652e77c925a2f5df4e0646bf568af453032bd2cb6eafdd9ea66d48
|
7
|
+
data.tar.gz: 23ec3628be52fd219206cd866c7e46757cdae9c8bd5c29334a7471c856f19becb03af7da2dd6f12a12c1f876f4eb900d10f9c8fdd7ad669c1bf2dea4cb333145
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/rubocop.svg)](https://badge.fury.io/rb/rubocop)
|
2
2
|
[![CircleCI Status](https://circleci.com/gh/rubocop-hq/rubocop/tree/master.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop/tree/master)
|
3
|
-
[![
|
3
|
+
[![Actions Status](https://github.com/rubocop-hq/rubocop/workflows/CI/badge.svg?branch=master)](https://github.com/rubocop-hq/rubocop/actions?query=workflow%3ACI)
|
4
4
|
[![Coverage Status](https://api.codeclimate.com/v1/badges/ad6e76460499c8c99697/test_coverage)](https://codeclimate.com/github/bbatsov/rubocop)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/bbatsov/rubocop/badges/gpa.svg)](https://codeclimate.com/github/bbatsov/rubocop)
|
6
6
|
[![Inline docs](https://inch-ci.org/github/bbatsov/rubocop.svg)](https://inch-ci.org/github/bbatsov/rubocop)
|
@@ -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.83.0', require: false
|
57
57
|
```
|
58
58
|
|
59
59
|
## Quickstart
|
@@ -73,7 +73,7 @@ You can read a lot more about RuboCop in its [official docs](https://docs.ruboco
|
|
73
73
|
|
74
74
|
RuboCop supports the following Ruby implementations:
|
75
75
|
|
76
|
-
* MRI 2.
|
76
|
+
* MRI 2.4+
|
77
77
|
* JRuby 9.2+
|
78
78
|
|
79
79
|
## Team
|
@@ -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
@@ -35,6 +35,7 @@ AllCops:
|
|
35
35
|
- '**/*.watchr'
|
36
36
|
- '**/.irbrc'
|
37
37
|
- '**/.pryrc'
|
38
|
+
- '**/.simplecov'
|
38
39
|
- '**/buildfile'
|
39
40
|
- '**/Appraisals'
|
40
41
|
- '**/Berksfile'
|
@@ -53,7 +54,9 @@ AllCops:
|
|
53
54
|
- '**/Podfile'
|
54
55
|
- '**/Puppetfile'
|
55
56
|
- '**/Rakefile'
|
57
|
+
- '**/rakefile'
|
56
58
|
- '**/Snapfile'
|
59
|
+
- '**/Steepfile'
|
57
60
|
- '**/Thorfile'
|
58
61
|
- '**/Vagabondfile'
|
59
62
|
- '**/Vagrantfile'
|
@@ -96,6 +99,14 @@ AllCops:
|
|
96
99
|
# to true in the same configuration.
|
97
100
|
EnabledByDefault: false
|
98
101
|
DisabledByDefault: false
|
102
|
+
# New cops introduced between major versions are set to a special pending status
|
103
|
+
# and are not enabled by default with warning message.
|
104
|
+
# Change this behavior by overriding either `NewCops: enable` or `NewCops: disable`.
|
105
|
+
# When `NewCops` is `enable`, pending cops are enabled in bulk. Can be overridden by
|
106
|
+
# the `--enable-pending-cops` command-line option.
|
107
|
+
# When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
|
108
|
+
# the `--disable-pending-cops` command-line option.
|
109
|
+
NewCops: pending
|
99
110
|
# Enables the result cache if `true`. Can be overridden by the `--cache` command
|
100
111
|
# line option.
|
101
112
|
UseCache: true
|
@@ -124,7 +135,7 @@ AllCops:
|
|
124
135
|
# followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
|
125
136
|
# is specified in the Gemfile or gems.rb file, RuboCop reads the final value
|
126
137
|
# from the lock file.) If the Ruby version is still unresolved, RuboCop will
|
127
|
-
# use the oldest officially supported Ruby version (currently Ruby 2.
|
138
|
+
# use the oldest officially supported Ruby version (currently Ruby 2.4).
|
128
139
|
TargetRubyVersion: ~
|
129
140
|
|
130
141
|
#################### Bundler ###############################
|
@@ -254,10 +265,30 @@ Layout/ArrayAlignment:
|
|
254
265
|
Description: >-
|
255
266
|
Align the elements of an array literal if they span more than
|
256
267
|
one line.
|
257
|
-
StyleGuide: '#
|
268
|
+
StyleGuide: '#no-double-indent'
|
258
269
|
Enabled: true
|
259
270
|
VersionAdded: '0.49'
|
260
271
|
VersionChanged: '0.77'
|
272
|
+
# Alignment of elements of a multi-line array.
|
273
|
+
#
|
274
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
275
|
+
# column as the first element.
|
276
|
+
#
|
277
|
+
# array = [1, 2, 3,
|
278
|
+
# 4, 5, 6]
|
279
|
+
#
|
280
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
281
|
+
# level of indentation relative to the start of the line with start of array.
|
282
|
+
#
|
283
|
+
# array = [1, 2, 3,
|
284
|
+
# 4, 5, 6]
|
285
|
+
EnforcedStyle: with_first_element
|
286
|
+
SupportedStyles:
|
287
|
+
- with_first_element
|
288
|
+
- with_fixed_indentation
|
289
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
290
|
+
# But it can be overridden by setting this parameter
|
291
|
+
IndentationWidth: ~
|
261
292
|
|
262
293
|
Layout/AssignmentIndentation:
|
263
294
|
Description: >-
|
@@ -346,6 +377,7 @@ Layout/ConditionPosition:
|
|
346
377
|
StyleGuide: '#same-line-condition'
|
347
378
|
Enabled: true
|
348
379
|
VersionAdded: '0.53'
|
380
|
+
VersionChanged: '0.83'
|
349
381
|
|
350
382
|
Layout/DefEndAlignment:
|
351
383
|
Description: 'Align ends corresponding to defs correctly.'
|
@@ -431,6 +463,12 @@ Layout/EmptyLinesAroundArguments:
|
|
431
463
|
Enabled: true
|
432
464
|
VersionAdded: '0.52'
|
433
465
|
|
466
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
467
|
+
Description: "Keep blank lines around attribute accessors."
|
468
|
+
StyleGuide: '#empty-lines-around-attribute-accessor'
|
469
|
+
Enabled: pending
|
470
|
+
VersionAdded: '0.83'
|
471
|
+
|
434
472
|
Layout/EmptyLinesAroundBeginBody:
|
435
473
|
Description: "Keeps track of empty lines around begin-end bodies."
|
436
474
|
StyleGuide: '#empty-lines-around-bodies'
|
@@ -772,6 +810,22 @@ Layout/IndentationConsistency:
|
|
772
810
|
# A reference to `EnforcedStyle: indented_internal_methods`.
|
773
811
|
- https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
|
774
812
|
|
813
|
+
Layout/IndentationStyle:
|
814
|
+
Description: 'Consistent indentation either with tabs only or spaces only.'
|
815
|
+
StyleGuide: '#spaces-indentation'
|
816
|
+
Enabled: true
|
817
|
+
VersionAdded: '0.49'
|
818
|
+
VersionChanged: '0.82'
|
819
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
820
|
+
# But it can be overridden by setting this parameter
|
821
|
+
# It is used during auto-correction to determine how many spaces should
|
822
|
+
# replace each tab.
|
823
|
+
IndentationWidth: ~
|
824
|
+
EnforcedStyle: spaces
|
825
|
+
SupportedStyles:
|
826
|
+
- spaces
|
827
|
+
- tabs
|
828
|
+
|
775
829
|
Layout/IndentationWidth:
|
776
830
|
Description: 'Use 2 spaces for indentation.'
|
777
831
|
StyleGuide: '#spaces-indentation'
|
@@ -794,6 +848,7 @@ Layout/LeadingCommentSpace:
|
|
794
848
|
VersionAdded: '0.49'
|
795
849
|
VersionChanged: '0.73'
|
796
850
|
AllowDoxygenCommentStyle: false
|
851
|
+
AllowGemfileRubyComment: false
|
797
852
|
|
798
853
|
Layout/LeadingEmptyLines:
|
799
854
|
Description: Check for unnecessary blank lines at the beginning of a file.
|
@@ -1058,6 +1113,11 @@ Layout/SpaceAroundKeyword:
|
|
1058
1113
|
Enabled: true
|
1059
1114
|
VersionAdded: '0.49'
|
1060
1115
|
|
1116
|
+
Layout/SpaceAroundMethodCallOperator:
|
1117
|
+
Description: 'Checks method call operators to not have spaces around them.'
|
1118
|
+
Enabled: pending
|
1119
|
+
VersionAdded: '0.82'
|
1120
|
+
|
1061
1121
|
Layout/SpaceAroundOperators:
|
1062
1122
|
Description: 'Use a single space around operators.'
|
1063
1123
|
StyleGuide: '#spaces-operators'
|
@@ -1228,18 +1288,6 @@ Layout/SpaceInsideStringInterpolation:
|
|
1228
1288
|
- space
|
1229
1289
|
- no_space
|
1230
1290
|
|
1231
|
-
Layout/Tab:
|
1232
|
-
Description: 'No hard tabs.'
|
1233
|
-
StyleGuide: '#spaces-indentation'
|
1234
|
-
Enabled: true
|
1235
|
-
VersionAdded: '0.49'
|
1236
|
-
VersionChanged: '0.51'
|
1237
|
-
# By default, the indentation width from Layout/IndentationWidth is used
|
1238
|
-
# But it can be overridden by setting this parameter
|
1239
|
-
# It is used during auto-correction to determine how many spaces should
|
1240
|
-
# replace each tab.
|
1241
|
-
IndentationWidth: ~
|
1242
|
-
|
1243
1291
|
Layout/TrailingEmptyLines:
|
1244
1292
|
Description: 'Checks trailing blank lines and final newline.'
|
1245
1293
|
StyleGuide: '#newline-eof'
|
@@ -1256,8 +1304,8 @@ Layout/TrailingWhitespace:
|
|
1256
1304
|
StyleGuide: '#no-trailing-whitespace'
|
1257
1305
|
Enabled: true
|
1258
1306
|
VersionAdded: '0.49'
|
1259
|
-
VersionChanged: '0.
|
1260
|
-
AllowInHeredoc:
|
1307
|
+
VersionChanged: '0.83'
|
1308
|
+
AllowInHeredoc: true
|
1261
1309
|
|
1262
1310
|
#################### Lint ##################################
|
1263
1311
|
### Warnings
|
@@ -1277,6 +1325,7 @@ Lint/AmbiguousOperator:
|
|
1277
1325
|
StyleGuide: '#method-invocation-parens'
|
1278
1326
|
Enabled: true
|
1279
1327
|
VersionAdded: '0.17'
|
1328
|
+
VersionChanged: '0.83'
|
1280
1329
|
|
1281
1330
|
Lint/AmbiguousRegexpLiteral:
|
1282
1331
|
Description: >-
|
@@ -1284,6 +1333,7 @@ Lint/AmbiguousRegexpLiteral:
|
|
1284
1333
|
a method invocation without parentheses.
|
1285
1334
|
Enabled: true
|
1286
1335
|
VersionAdded: '0.17'
|
1336
|
+
VersionChanged: '0.83'
|
1287
1337
|
|
1288
1338
|
Lint/AssignmentInCondition:
|
1289
1339
|
Description: "Don't use assignment in conditions."
|
@@ -1300,7 +1350,9 @@ Lint/BigDecimalNew:
|
|
1300
1350
|
Lint/BooleanSymbol:
|
1301
1351
|
Description: 'Check for `:true` and `:false` symbols.'
|
1302
1352
|
Enabled: true
|
1353
|
+
Safe: false
|
1303
1354
|
VersionAdded: '0.50'
|
1355
|
+
VersionChanged: '0.83'
|
1304
1356
|
|
1305
1357
|
Lint/CircularArgumentReference:
|
1306
1358
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
@@ -1371,18 +1423,16 @@ Lint/EmptyInterpolation:
|
|
1371
1423
|
Lint/EmptyWhen:
|
1372
1424
|
Description: 'Checks for `when` branches with empty bodies.'
|
1373
1425
|
Enabled: true
|
1426
|
+
AllowComments: true
|
1374
1427
|
VersionAdded: '0.45'
|
1375
|
-
|
1376
|
-
Lint/EndInMethod:
|
1377
|
-
Description: 'END blocks should not be placed inside method definitions.'
|
1378
|
-
Enabled: true
|
1379
|
-
VersionAdded: '0.9'
|
1428
|
+
VersionChanged: '0.83'
|
1380
1429
|
|
1381
1430
|
Lint/EnsureReturn:
|
1382
1431
|
Description: 'Do not use return in an ensure block.'
|
1383
1432
|
StyleGuide: '#no-return-ensure'
|
1384
1433
|
Enabled: true
|
1385
1434
|
VersionAdded: '0.9'
|
1435
|
+
VersionChanged: '0.83'
|
1386
1436
|
|
1387
1437
|
Lint/ErbNewArguments:
|
1388
1438
|
Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
|
@@ -1530,6 +1580,7 @@ Lint/ParenthesesAsGroupedExpression:
|
|
1530
1580
|
StyleGuide: '#parens-no-spaces'
|
1531
1581
|
Enabled: true
|
1532
1582
|
VersionAdded: '0.12'
|
1583
|
+
VersionChanged: '0.83'
|
1533
1584
|
|
1534
1585
|
Lint/PercentStringArray:
|
1535
1586
|
Description: >-
|
@@ -1544,6 +1595,14 @@ Lint/PercentSymbolArray:
|
|
1544
1595
|
Enabled: true
|
1545
1596
|
VersionAdded: '0.41'
|
1546
1597
|
|
1598
|
+
Lint/RaiseException:
|
1599
|
+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1600
|
+
StyleGuide: '#raise-exception'
|
1601
|
+
Enabled: pending
|
1602
|
+
VersionAdded: '0.81'
|
1603
|
+
AllowedImplicitNamespaces:
|
1604
|
+
- 'Gem'
|
1605
|
+
|
1547
1606
|
Lint/RandOne:
|
1548
1607
|
Description: >-
|
1549
1608
|
Checks for `rand(1)` calls. Such calls always return `0`
|
@@ -1572,7 +1631,7 @@ Lint/RedundantRequireStatement:
|
|
1572
1631
|
Lint/RedundantSplatExpansion:
|
1573
1632
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
1574
1633
|
Enabled: true
|
1575
|
-
|
1634
|
+
VersionAdded: '0.76'
|
1576
1635
|
|
1577
1636
|
Lint/RedundantStringCoercion:
|
1578
1637
|
Description: 'Checks for Object#to_s usage in string interpolation.'
|
@@ -1686,13 +1745,18 @@ Lint/ShadowingOuterLocalVariable:
|
|
1686
1745
|
Enabled: true
|
1687
1746
|
VersionAdded: '0.9'
|
1688
1747
|
|
1748
|
+
Lint/StructNewOverride:
|
1749
|
+
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1750
|
+
Enabled: pending
|
1751
|
+
VersionAdded: '0.81'
|
1752
|
+
|
1689
1753
|
Lint/SuppressedException:
|
1690
1754
|
Description: "Don't suppress exceptions."
|
1691
1755
|
StyleGuide: '#dont-hide-exceptions'
|
1692
1756
|
Enabled: true
|
1693
|
-
AllowComments:
|
1757
|
+
AllowComments: true
|
1694
1758
|
VersionAdded: '0.9'
|
1695
|
-
VersionChanged: '0.
|
1759
|
+
VersionChanged: '0.81'
|
1696
1760
|
|
1697
1761
|
Lint/Syntax:
|
1698
1762
|
Description: 'Checks syntax error.'
|
@@ -1703,6 +1767,7 @@ Lint/Syntax:
|
|
1703
1767
|
Lint/ToJSON:
|
1704
1768
|
Description: 'Ensure #to_json includes an optional argument.'
|
1705
1769
|
Enabled: true
|
1770
|
+
VersionAdded: '0.66'
|
1706
1771
|
|
1707
1772
|
Lint/UnderscorePrefixedVariableName:
|
1708
1773
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
@@ -1734,9 +1799,10 @@ Lint/UnusedMethodArgument:
|
|
1734
1799
|
StyleGuide: '#underscore-unused-vars'
|
1735
1800
|
Enabled: true
|
1736
1801
|
VersionAdded: '0.21'
|
1737
|
-
VersionChanged: '0.
|
1802
|
+
VersionChanged: '0.81'
|
1738
1803
|
AllowUnusedKeywordArguments: false
|
1739
1804
|
IgnoreEmptyMethods: true
|
1805
|
+
IgnoreNotImplementedMethods: true
|
1740
1806
|
|
1741
1807
|
Lint/UriEscapeUnescape:
|
1742
1808
|
Description: >-
|
@@ -1758,7 +1824,7 @@ Lint/UselessAccessModifier:
|
|
1758
1824
|
Description: 'Checks for useless access modifiers.'
|
1759
1825
|
Enabled: true
|
1760
1826
|
VersionAdded: '0.20'
|
1761
|
-
VersionChanged: '0.
|
1827
|
+
VersionChanged: '0.83'
|
1762
1828
|
ContextCreatingMethods: []
|
1763
1829
|
MethodCreatingMethods: []
|
1764
1830
|
|
@@ -1782,6 +1848,8 @@ Lint/UselessSetterCall:
|
|
1782
1848
|
Description: 'Checks for useless setter call to a local variable.'
|
1783
1849
|
Enabled: true
|
1784
1850
|
VersionAdded: '0.13'
|
1851
|
+
VersionChanged: '0.80'
|
1852
|
+
Safe: false
|
1785
1853
|
|
1786
1854
|
Lint/Void:
|
1787
1855
|
Description: 'Possible use of operator/literal/variable in void context.'
|
@@ -1800,9 +1868,10 @@ Metrics/AbcSize:
|
|
1800
1868
|
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
1801
1869
|
Enabled: true
|
1802
1870
|
VersionAdded: '0.27'
|
1803
|
-
VersionChanged: '0.
|
1871
|
+
VersionChanged: '0.81'
|
1804
1872
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
1805
1873
|
# a Float.
|
1874
|
+
IgnoredMethods: []
|
1806
1875
|
Max: 15
|
1807
1876
|
|
1808
1877
|
Metrics/BlockLength:
|
@@ -1842,6 +1911,8 @@ Metrics/CyclomaticComplexity:
|
|
1842
1911
|
of test cases needed to validate a method.
|
1843
1912
|
Enabled: true
|
1844
1913
|
VersionAdded: '0.25'
|
1914
|
+
VersionChanged: '0.81'
|
1915
|
+
IgnoredMethods: []
|
1845
1916
|
Max: 6
|
1846
1917
|
|
1847
1918
|
Metrics/MethodLength:
|
@@ -1875,6 +1946,8 @@ Metrics/PerceivedComplexity:
|
|
1875
1946
|
human reader.
|
1876
1947
|
Enabled: true
|
1877
1948
|
VersionAdded: '0.25'
|
1949
|
+
VersionChanged: '0.81'
|
1950
|
+
IgnoredMethods: []
|
1878
1951
|
Max: 7
|
1879
1952
|
|
1880
1953
|
################## Migration #############################
|
@@ -1883,7 +1956,8 @@ Migration/DepartmentName:
|
|
1883
1956
|
Description: >-
|
1884
1957
|
Check that cop names in rubocop:disable (etc) comments are
|
1885
1958
|
given with department name.
|
1886
|
-
Enabled:
|
1959
|
+
Enabled: true
|
1960
|
+
VersionAdded: '0.75'
|
1887
1961
|
|
1888
1962
|
#################### Naming ##############################
|
1889
1963
|
|
@@ -2065,6 +2139,7 @@ Naming/MethodParameterName:
|
|
2065
2139
|
- ip
|
2066
2140
|
- db
|
2067
2141
|
- os
|
2142
|
+
- pp
|
2068
2143
|
# Forbidden names that will register an offense
|
2069
2144
|
ForbiddenNames: []
|
2070
2145
|
|
@@ -2173,10 +2248,12 @@ Style/AccessModifierDeclarations:
|
|
2173
2248
|
Description: 'Checks style of how access modifiers are used.'
|
2174
2249
|
Enabled: true
|
2175
2250
|
VersionAdded: '0.57'
|
2251
|
+
VersionChanged: '0.81'
|
2176
2252
|
EnforcedStyle: group
|
2177
2253
|
SupportedStyles:
|
2178
2254
|
- inline
|
2179
2255
|
- group
|
2256
|
+
AllowModifiersOnSymbols: true
|
2180
2257
|
|
2181
2258
|
Style/Alias:
|
2182
2259
|
Description: 'Use alias instead of alias_method.'
|
@@ -2355,30 +2432,27 @@ Style/BlockDelimiters:
|
|
2355
2432
|
# # also good
|
2356
2433
|
# collection.each do |element| puts element end
|
2357
2434
|
AllowBracesOnProceduralOneLiners: false
|
2358
|
-
|
2359
|
-
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2364
|
-
EnforcedStyle: no_braces
|
2365
|
-
SupportedStyles:
|
2366
|
-
# The `braces` style enforces braces around all method parameters that are
|
2367
|
-
# hashes.
|
2368
|
-
- braces
|
2369
|
-
# The `no_braces` style checks that the last parameter doesn't have braces
|
2370
|
-
# around it.
|
2371
|
-
- no_braces
|
2372
|
-
# The `context_dependent` style checks that the last parameter doesn't have
|
2373
|
-
# braces around it, but requires braces if the second to last parameter is
|
2374
|
-
# also a hash literal.
|
2375
|
-
- context_dependent
|
2435
|
+
# The BracesRequiredMethods overrides all other configurations except
|
2436
|
+
# IgnoredMethods. It can be used to enforce that all blocks for specific
|
2437
|
+
# methods use braces. For example, you can use this to enforce Sorbet
|
2438
|
+
# signatures use braces even when the rest of your codebase enforces
|
2439
|
+
# the `line_count_based` style.
|
2440
|
+
BracesRequiredMethods: []
|
2376
2441
|
|
2377
2442
|
Style/CaseEquality:
|
2378
2443
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
2379
2444
|
StyleGuide: '#no-case-equality'
|
2380
2445
|
Enabled: true
|
2381
2446
|
VersionAdded: '0.9'
|
2447
|
+
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
|
2448
|
+
# the case equality operator is a constant.
|
2449
|
+
#
|
2450
|
+
# # bad
|
2451
|
+
# /string/ === "string"
|
2452
|
+
#
|
2453
|
+
# # good
|
2454
|
+
# String === "string"
|
2455
|
+
AllowOnConstant: false
|
2382
2456
|
|
2383
2457
|
Style/CharacterLiteral:
|
2384
2458
|
Description: 'Checks for uses of character literals.'
|
@@ -2419,6 +2493,7 @@ Style/ClassAndModuleChildren:
|
|
2419
2493
|
|
2420
2494
|
Style/ClassCheck:
|
2421
2495
|
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
2496
|
+
StyleGuide: '#is-a-vs-kind-of'
|
2422
2497
|
Enabled: true
|
2423
2498
|
VersionAdded: '0.24'
|
2424
2499
|
EnforcedStyle: is_a?
|
@@ -2442,7 +2517,7 @@ Style/ClassVars:
|
|
2442
2517
|
# Align with the style guide.
|
2443
2518
|
Style/CollectionMethods:
|
2444
2519
|
Description: 'Preferred collection methods.'
|
2445
|
-
StyleGuide: '#map-find-select-reduce-size'
|
2520
|
+
StyleGuide: '#map-find-select-reduce-include-size'
|
2446
2521
|
Enabled: false
|
2447
2522
|
VersionAdded: '0.9'
|
2448
2523
|
VersionChanged: '0.27'
|
@@ -2459,6 +2534,7 @@ Style/CollectionMethods:
|
|
2459
2534
|
inject: 'reduce'
|
2460
2535
|
detect: 'find'
|
2461
2536
|
find_all: 'select'
|
2537
|
+
member?: 'include?'
|
2462
2538
|
|
2463
2539
|
Style/ColonMethodCall:
|
2464
2540
|
Description: 'Do not use :: for method call.'
|
@@ -2585,6 +2661,12 @@ Style/Dir:
|
|
2585
2661
|
Enabled: true
|
2586
2662
|
VersionAdded: '0.50'
|
2587
2663
|
|
2664
|
+
Style/DisableCopsWithinSourceCodeDirective:
|
2665
|
+
Description: >-
|
2666
|
+
Forbids disabling/enabling cops within source code.
|
2667
|
+
Enabled: false
|
2668
|
+
VersionAdded: '0.82'
|
2669
|
+
|
2588
2670
|
Style/Documentation:
|
2589
2671
|
Description: 'Document classes and non-namespace modules.'
|
2590
2672
|
Enabled: true
|
@@ -2684,6 +2766,7 @@ Style/EndBlock:
|
|
2684
2766
|
StyleGuide: '#no-END-blocks'
|
2685
2767
|
Enabled: true
|
2686
2768
|
VersionAdded: '0.9'
|
2769
|
+
VersionChanged: '0.81'
|
2687
2770
|
|
2688
2771
|
Style/EvalWithLocation:
|
2689
2772
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
@@ -2702,6 +2785,17 @@ Style/ExpandPathArguments:
|
|
2702
2785
|
Enabled: true
|
2703
2786
|
VersionAdded: '0.53'
|
2704
2787
|
|
2788
|
+
Style/ExponentialNotation:
|
2789
|
+
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
2790
|
+
StyleGuide: '#exponential-notation'
|
2791
|
+
Enabled: pending
|
2792
|
+
VersionAdded: '0.82'
|
2793
|
+
EnforcedStyle: scientific
|
2794
|
+
SupportedStyles:
|
2795
|
+
- scientific
|
2796
|
+
- engineering
|
2797
|
+
- integral
|
2798
|
+
|
2705
2799
|
Style/FloatDivision:
|
2706
2800
|
Description: 'For performing float division, coerce one side only.'
|
2707
2801
|
StyleGuide: '#float-division'
|
@@ -2766,6 +2860,10 @@ Style/FrozenStringLiteralComment:
|
|
2766
2860
|
# string literal. If you run code against multiple versions of Ruby, it is
|
2767
2861
|
# possible that this will create errors in Ruby 2.3.0+.
|
2768
2862
|
- always
|
2863
|
+
# `always_true` will add the frozen string literal comment to a file,
|
2864
|
+
# similarly to the `always` style, but will also change any disabled
|
2865
|
+
# comments (e.g. `# frozen_string_literal: false`) to be enabled.
|
2866
|
+
- always_true
|
2769
2867
|
# `never` will enforce that the frozen string literal comment does not
|
2770
2868
|
# exist in a file.
|
2771
2869
|
- never
|
@@ -2790,6 +2888,13 @@ Style/GuardClause:
|
|
2790
2888
|
# needs to have to trigger this cop
|
2791
2889
|
MinBodyLength: 1
|
2792
2890
|
|
2891
|
+
Style/HashEachMethods:
|
2892
|
+
Description: 'Use Hash#each_key and Hash#each_value.'
|
2893
|
+
StyleGuide: '#hash-each'
|
2894
|
+
Enabled: pending
|
2895
|
+
VersionAdded: '0.80'
|
2896
|
+
Safe: false
|
2897
|
+
|
2793
2898
|
Style/HashSyntax:
|
2794
2899
|
Description: >-
|
2795
2900
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
@@ -2813,6 +2918,18 @@ Style/HashSyntax:
|
|
2813
2918
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
2814
2919
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
2815
2920
|
|
2921
|
+
Style/HashTransformKeys:
|
2922
|
+
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
2923
|
+
Enabled: 'pending'
|
2924
|
+
VersionAdded: '0.80'
|
2925
|
+
Safe: false
|
2926
|
+
|
2927
|
+
Style/HashTransformValues:
|
2928
|
+
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
2929
|
+
Enabled: 'pending'
|
2930
|
+
VersionAdded: '0.80'
|
2931
|
+
Safe: false
|
2932
|
+
|
2816
2933
|
Style/IdenticalConditionalBranches:
|
2817
2934
|
Description: >-
|
2818
2935
|
Checks that conditional statements do not have an identical
|
@@ -2847,6 +2964,7 @@ Style/IfWithSemicolon:
|
|
2847
2964
|
StyleGuide: '#no-semicolon-ifs'
|
2848
2965
|
Enabled: true
|
2849
2966
|
VersionAdded: '0.9'
|
2967
|
+
VersionChanged: '0.83'
|
2850
2968
|
|
2851
2969
|
Style/ImplicitRuntimeError:
|
2852
2970
|
Description: >-
|
@@ -2921,7 +3039,7 @@ Style/LambdaCall:
|
|
2921
3039
|
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
2922
3040
|
StyleGuide: '#proc-call'
|
2923
3041
|
Enabled: true
|
2924
|
-
VersionAdded: '0.13
|
3042
|
+
VersionAdded: '0.13'
|
2925
3043
|
VersionChanged: '0.14'
|
2926
3044
|
EnforcedStyle: call
|
2927
3045
|
SupportedStyles:
|
@@ -3051,6 +3169,7 @@ Style/ModuleFunction:
|
|
3051
3169
|
SupportedStyles:
|
3052
3170
|
- module_function
|
3053
3171
|
- extend_self
|
3172
|
+
- forbidden
|
3054
3173
|
Autocorrect: false
|
3055
3174
|
SafeAutoCorrect: false
|
3056
3175
|
|
@@ -3323,7 +3442,9 @@ Style/OptionalArguments:
|
|
3323
3442
|
of the argument list.
|
3324
3443
|
StyleGuide: '#optional-arguments'
|
3325
3444
|
Enabled: true
|
3445
|
+
Safe: false
|
3326
3446
|
VersionAdded: '0.33'
|
3447
|
+
VersionChanged: '0.83'
|
3327
3448
|
|
3328
3449
|
Style/OrAssignment:
|
3329
3450
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
@@ -3628,6 +3749,12 @@ Style/SingleLineMethods:
|
|
3628
3749
|
VersionChanged: '0.19'
|
3629
3750
|
AllowIfMethodIsEmpty: true
|
3630
3751
|
|
3752
|
+
Style/SlicingWithRange:
|
3753
|
+
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
3754
|
+
Enabled: pending
|
3755
|
+
VersionAdded: '0.83'
|
3756
|
+
Safe: false
|
3757
|
+
|
3631
3758
|
Style/SpecialGlobalVars:
|
3632
3759
|
Description: 'Avoid Perl-style global variables.'
|
3633
3760
|
StyleGuide: '#no-cryptic-perlisms'
|
@@ -3790,22 +3917,29 @@ Style/TrailingCommaInArrayLiteral:
|
|
3790
3917
|
StyleGuide: '#no-trailing-array-commas'
|
3791
3918
|
Enabled: true
|
3792
3919
|
VersionAdded: '0.53'
|
3920
|
+
# If `comma`, the cop requires a comma after the last item in an array,
|
3793
3921
|
# but only when each item is on its own line.
|
3794
3922
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
3795
|
-
# non-empty array literals.
|
3923
|
+
# non-empty, multiline array literals.
|
3796
3924
|
EnforcedStyleForMultiline: no_comma
|
3797
3925
|
SupportedStylesForMultiline:
|
3798
3926
|
- comma
|
3799
3927
|
- consistent_comma
|
3800
3928
|
- no_comma
|
3801
3929
|
|
3930
|
+
Style/TrailingCommaInBlockArgs:
|
3931
|
+
Description: 'Checks for useless trailing commas in block arguments.'
|
3932
|
+
Enabled: false
|
3933
|
+
Safe: false
|
3934
|
+
VersionAdded: '0.81'
|
3935
|
+
|
3802
3936
|
Style/TrailingCommaInHashLiteral:
|
3803
3937
|
Description: 'Checks for trailing comma in hash literals.'
|
3804
3938
|
Enabled: true
|
3805
3939
|
# If `comma`, the cop requires a comma after the last item in a hash,
|
3806
3940
|
# but only when each item is on its own line.
|
3807
3941
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
3808
|
-
# non-empty hash literals.
|
3942
|
+
# non-empty, multiline hash literals.
|
3809
3943
|
EnforcedStyleForMultiline: no_comma
|
3810
3944
|
SupportedStylesForMultiline:
|
3811
3945
|
- comma
|