rubocop 0.78.0 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +4 -4
- data/config/default.yml +158 -48
- data/lib/rubocop.rb +19 -4
- data/lib/rubocop/ast/builder.rb +45 -42
- 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/def_node.rb +11 -0
- data/lib/rubocop/ast/node/forward_args_node.rb +18 -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/traversal.rb +29 -10
- data/lib/rubocop/cli.rb +10 -4
- data/lib/rubocop/cli/command/show_cops.rb +11 -4
- data/lib/rubocop/comment_config.rb +6 -1
- data/lib/rubocop/config.rb +36 -10
- data/lib/rubocop/config_loader.rb +42 -33
- data/lib/rubocop/config_loader_resolver.rb +1 -1
- data/lib/rubocop/config_obsoletion.rb +4 -1
- data/lib/rubocop/config_validator.rb +66 -92
- data/lib/rubocop/cop/autocorrect_logic.rb +6 -3
- 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/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/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/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/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/hash_alignment.rb +8 -4
- 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 +32 -3
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +15 -6
- 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/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 +19 -1
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +2 -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/lint/boolean_symbol.rb +12 -0
- data/lib/rubocop/cop/lint/debugger.rb +2 -2
- 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_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/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 -1
- 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 -22
- 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_setter_call.rb +4 -0
- data/lib/rubocop/cop/migration/department_name.rb +47 -6
- 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 +7 -7
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +171 -0
- data/lib/rubocop/cop/mixin/line_length_help.rb +1 -1
- data/lib/rubocop/cop/mixin/method_complexity.rb +5 -0
- data/lib/rubocop/cop/mixin/statement_modifier.rb +4 -3
- 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 +30 -0
- data/lib/rubocop/cop/naming/method_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +1 -1
- data/lib/rubocop/cop/registry.rb +15 -3
- 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 -1
- 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/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/inverse_methods.rb +9 -5
- data/lib/rubocop/cop/style/lambda.rb +3 -2
- data/lib/rubocop/cop/style/lambda_call.rb +2 -2
- 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/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 +5 -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 +5 -4
- data/lib/rubocop/cop/style/one_line_conditional.rb +4 -3
- data/lib/rubocop/cop/style/or_assignment.rb +4 -3
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +7 -7
- 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/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/yoda_condition.rb +16 -1
- data/lib/rubocop/cop/style/zero_length_predicate.rb +1 -1
- data/lib/rubocop/cop/variable_force.rb +4 -1
- 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/node_pattern.rb +96 -10
- data/lib/rubocop/options.rb +7 -1
- 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 +5 -4
- data/lib/rubocop/runner.rb +1 -1
- data/lib/rubocop/target_ruby.rb +151 -0
- data/lib/rubocop/version.rb +1 -1
- metadata +39 -12
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e04c6e897293df4ef1c7bf05a0c0077512e2cba797a7caee484b1c08a7300ad
|
4
|
+
data.tar.gz: 92fbc98b5068e5c30bf83d058e3cfe774a1a65cc90608027ff8d6624c8c2910c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cacf128617d233de65c2061d0300d345357840b151f65c78a2463fa23830115dcaa667cc2110ef39cacd14d957e626fc3fb4857443e40a1ab0fb485ce9cbfeed
|
7
|
+
data.tar.gz: f7a095da673a5b32de33293c6056c580995d1b2ad913e2891c1740ab1ffb42896f1b0c69491eb75656907b60e4de6f6a58a119c8936cff26d1ed678bc1159e0c
|
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.82.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
@@ -54,6 +54,7 @@ AllCops:
|
|
54
54
|
- '**/Puppetfile'
|
55
55
|
- '**/Rakefile'
|
56
56
|
- '**/Snapfile'
|
57
|
+
- '**/Steepfile'
|
57
58
|
- '**/Thorfile'
|
58
59
|
- '**/Vagabondfile'
|
59
60
|
- '**/Vagrantfile'
|
@@ -96,6 +97,14 @@ AllCops:
|
|
96
97
|
# to true in the same configuration.
|
97
98
|
EnabledByDefault: false
|
98
99
|
DisabledByDefault: false
|
100
|
+
# New cops introduced between major versions are set to a special pending status
|
101
|
+
# and are not enabled by default with warning message.
|
102
|
+
# Change this behavior by overriding either `NewCops: enable` or `NewCops: disable`.
|
103
|
+
# When `NewCops` is `enable`, pending cops are enabled in bulk. Can be overridden by
|
104
|
+
# the `--enable-pending-cops` command-line option.
|
105
|
+
# When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
|
106
|
+
# the `--disable-pending-cops` command-line option.
|
107
|
+
NewCops: pending
|
99
108
|
# Enables the result cache if `true`. Can be overridden by the `--cache` command
|
100
109
|
# line option.
|
101
110
|
UseCache: true
|
@@ -124,7 +133,7 @@ AllCops:
|
|
124
133
|
# followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
|
125
134
|
# is specified in the Gemfile or gems.rb file, RuboCop reads the final value
|
126
135
|
# from the lock file.) If the Ruby version is still unresolved, RuboCop will
|
127
|
-
# use the oldest officially supported Ruby version (currently Ruby 2.
|
136
|
+
# use the oldest officially supported Ruby version (currently Ruby 2.4).
|
128
137
|
TargetRubyVersion: ~
|
129
138
|
|
130
139
|
#################### Bundler ###############################
|
@@ -254,10 +263,30 @@ Layout/ArrayAlignment:
|
|
254
263
|
Description: >-
|
255
264
|
Align the elements of an array literal if they span more than
|
256
265
|
one line.
|
257
|
-
StyleGuide: '#
|
266
|
+
StyleGuide: '#no-double-indent'
|
258
267
|
Enabled: true
|
259
268
|
VersionAdded: '0.49'
|
260
269
|
VersionChanged: '0.77'
|
270
|
+
# Alignment of elements of a multi-line array.
|
271
|
+
#
|
272
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
273
|
+
# column as the first element.
|
274
|
+
#
|
275
|
+
# array = [1, 2, 3,
|
276
|
+
# 4, 5, 6]
|
277
|
+
#
|
278
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
279
|
+
# level of indentation relative to the start of the line with start of array.
|
280
|
+
#
|
281
|
+
# array = [1, 2, 3,
|
282
|
+
# 4, 5, 6]
|
283
|
+
EnforcedStyle: with_first_element
|
284
|
+
SupportedStyles:
|
285
|
+
- with_first_element
|
286
|
+
- with_fixed_indentation
|
287
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
288
|
+
# But it can be overridden by setting this parameter
|
289
|
+
IndentationWidth: ~
|
261
290
|
|
262
291
|
Layout/AssignmentIndentation:
|
263
292
|
Description: >-
|
@@ -772,6 +801,22 @@ Layout/IndentationConsistency:
|
|
772
801
|
# A reference to `EnforcedStyle: indented_internal_methods`.
|
773
802
|
- https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
|
774
803
|
|
804
|
+
Layout/IndentationStyle:
|
805
|
+
Description: 'Consistent indentation either with tabs only or spaces only.'
|
806
|
+
StyleGuide: '#spaces-indentation'
|
807
|
+
Enabled: true
|
808
|
+
VersionAdded: '0.49'
|
809
|
+
VersionChanged: '0.82'
|
810
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
811
|
+
# But it can be overridden by setting this parameter
|
812
|
+
# It is used during auto-correction to determine how many spaces should
|
813
|
+
# replace each tab.
|
814
|
+
IndentationWidth: ~
|
815
|
+
EnforcedStyle: spaces
|
816
|
+
SupportedStyles:
|
817
|
+
- spaces
|
818
|
+
- tabs
|
819
|
+
|
775
820
|
Layout/IndentationWidth:
|
776
821
|
Description: 'Use 2 spaces for indentation.'
|
777
822
|
StyleGuide: '#spaces-indentation'
|
@@ -794,6 +839,7 @@ Layout/LeadingCommentSpace:
|
|
794
839
|
VersionAdded: '0.49'
|
795
840
|
VersionChanged: '0.73'
|
796
841
|
AllowDoxygenCommentStyle: false
|
842
|
+
AllowGemfileRubyComment: false
|
797
843
|
|
798
844
|
Layout/LeadingEmptyLines:
|
799
845
|
Description: Check for unnecessary blank lines at the beginning of a file.
|
@@ -1058,6 +1104,11 @@ Layout/SpaceAroundKeyword:
|
|
1058
1104
|
Enabled: true
|
1059
1105
|
VersionAdded: '0.49'
|
1060
1106
|
|
1107
|
+
Layout/SpaceAroundMethodCallOperator:
|
1108
|
+
Description: 'Checks method call operators to not have spaces around them.'
|
1109
|
+
Enabled: pending
|
1110
|
+
VersionAdded: '0.82'
|
1111
|
+
|
1061
1112
|
Layout/SpaceAroundOperators:
|
1062
1113
|
Description: 'Use a single space around operators.'
|
1063
1114
|
StyleGuide: '#spaces-operators'
|
@@ -1228,18 +1279,6 @@ Layout/SpaceInsideStringInterpolation:
|
|
1228
1279
|
- space
|
1229
1280
|
- no_space
|
1230
1281
|
|
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
1282
|
Layout/TrailingEmptyLines:
|
1244
1283
|
Description: 'Checks trailing blank lines and final newline.'
|
1245
1284
|
StyleGuide: '#newline-eof'
|
@@ -1301,6 +1340,7 @@ Lint/BooleanSymbol:
|
|
1301
1340
|
Description: 'Check for `:true` and `:false` symbols.'
|
1302
1341
|
Enabled: true
|
1303
1342
|
VersionAdded: '0.50'
|
1343
|
+
VersionChanged: '0.81'
|
1304
1344
|
|
1305
1345
|
Lint/CircularArgumentReference:
|
1306
1346
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
@@ -1373,11 +1413,6 @@ Lint/EmptyWhen:
|
|
1373
1413
|
Enabled: true
|
1374
1414
|
VersionAdded: '0.45'
|
1375
1415
|
|
1376
|
-
Lint/EndInMethod:
|
1377
|
-
Description: 'END blocks should not be placed inside method definitions.'
|
1378
|
-
Enabled: true
|
1379
|
-
VersionAdded: '0.9'
|
1380
|
-
|
1381
1416
|
Lint/EnsureReturn:
|
1382
1417
|
Description: 'Do not use return in an ensure block.'
|
1383
1418
|
StyleGuide: '#no-return-ensure'
|
@@ -1544,6 +1579,14 @@ Lint/PercentSymbolArray:
|
|
1544
1579
|
Enabled: true
|
1545
1580
|
VersionAdded: '0.41'
|
1546
1581
|
|
1582
|
+
Lint/RaiseException:
|
1583
|
+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1584
|
+
StyleGuide: '#raise-exception'
|
1585
|
+
Enabled: pending
|
1586
|
+
VersionAdded: '0.81'
|
1587
|
+
AllowedImplicitNamespaces:
|
1588
|
+
- 'Gem'
|
1589
|
+
|
1547
1590
|
Lint/RandOne:
|
1548
1591
|
Description: >-
|
1549
1592
|
Checks for `rand(1)` calls. Such calls always return `0`
|
@@ -1572,7 +1615,7 @@ Lint/RedundantRequireStatement:
|
|
1572
1615
|
Lint/RedundantSplatExpansion:
|
1573
1616
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
1574
1617
|
Enabled: true
|
1575
|
-
|
1618
|
+
VersionAdded: '0.76'
|
1576
1619
|
|
1577
1620
|
Lint/RedundantStringCoercion:
|
1578
1621
|
Description: 'Checks for Object#to_s usage in string interpolation.'
|
@@ -1686,13 +1729,18 @@ Lint/ShadowingOuterLocalVariable:
|
|
1686
1729
|
Enabled: true
|
1687
1730
|
VersionAdded: '0.9'
|
1688
1731
|
|
1732
|
+
Lint/StructNewOverride:
|
1733
|
+
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1734
|
+
Enabled: pending
|
1735
|
+
VersionAdded: '0.81'
|
1736
|
+
|
1689
1737
|
Lint/SuppressedException:
|
1690
1738
|
Description: "Don't suppress exceptions."
|
1691
1739
|
StyleGuide: '#dont-hide-exceptions'
|
1692
1740
|
Enabled: true
|
1693
|
-
AllowComments:
|
1741
|
+
AllowComments: true
|
1694
1742
|
VersionAdded: '0.9'
|
1695
|
-
VersionChanged: '0.
|
1743
|
+
VersionChanged: '0.81'
|
1696
1744
|
|
1697
1745
|
Lint/Syntax:
|
1698
1746
|
Description: 'Checks syntax error.'
|
@@ -1703,6 +1751,7 @@ Lint/Syntax:
|
|
1703
1751
|
Lint/ToJSON:
|
1704
1752
|
Description: 'Ensure #to_json includes an optional argument.'
|
1705
1753
|
Enabled: true
|
1754
|
+
VersionAdded: '0.66'
|
1706
1755
|
|
1707
1756
|
Lint/UnderscorePrefixedVariableName:
|
1708
1757
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
@@ -1734,9 +1783,10 @@ Lint/UnusedMethodArgument:
|
|
1734
1783
|
StyleGuide: '#underscore-unused-vars'
|
1735
1784
|
Enabled: true
|
1736
1785
|
VersionAdded: '0.21'
|
1737
|
-
VersionChanged: '0.
|
1786
|
+
VersionChanged: '0.81'
|
1738
1787
|
AllowUnusedKeywordArguments: false
|
1739
1788
|
IgnoreEmptyMethods: true
|
1789
|
+
IgnoreNotImplementedMethods: true
|
1740
1790
|
|
1741
1791
|
Lint/UriEscapeUnescape:
|
1742
1792
|
Description: >-
|
@@ -1782,6 +1832,8 @@ Lint/UselessSetterCall:
|
|
1782
1832
|
Description: 'Checks for useless setter call to a local variable.'
|
1783
1833
|
Enabled: true
|
1784
1834
|
VersionAdded: '0.13'
|
1835
|
+
VersionChanged: '0.80'
|
1836
|
+
Safe: false
|
1785
1837
|
|
1786
1838
|
Lint/Void:
|
1787
1839
|
Description: 'Possible use of operator/literal/variable in void context.'
|
@@ -1800,9 +1852,10 @@ Metrics/AbcSize:
|
|
1800
1852
|
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
1801
1853
|
Enabled: true
|
1802
1854
|
VersionAdded: '0.27'
|
1803
|
-
VersionChanged: '0.
|
1855
|
+
VersionChanged: '0.81'
|
1804
1856
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
1805
1857
|
# a Float.
|
1858
|
+
IgnoredMethods: []
|
1806
1859
|
Max: 15
|
1807
1860
|
|
1808
1861
|
Metrics/BlockLength:
|
@@ -1842,6 +1895,8 @@ Metrics/CyclomaticComplexity:
|
|
1842
1895
|
of test cases needed to validate a method.
|
1843
1896
|
Enabled: true
|
1844
1897
|
VersionAdded: '0.25'
|
1898
|
+
VersionChanged: '0.81'
|
1899
|
+
IgnoredMethods: []
|
1845
1900
|
Max: 6
|
1846
1901
|
|
1847
1902
|
Metrics/MethodLength:
|
@@ -1875,6 +1930,8 @@ Metrics/PerceivedComplexity:
|
|
1875
1930
|
human reader.
|
1876
1931
|
Enabled: true
|
1877
1932
|
VersionAdded: '0.25'
|
1933
|
+
VersionChanged: '0.81'
|
1934
|
+
IgnoredMethods: []
|
1878
1935
|
Max: 7
|
1879
1936
|
|
1880
1937
|
################## Migration #############################
|
@@ -1883,7 +1940,8 @@ Migration/DepartmentName:
|
|
1883
1940
|
Description: >-
|
1884
1941
|
Check that cop names in rubocop:disable (etc) comments are
|
1885
1942
|
given with department name.
|
1886
|
-
Enabled:
|
1943
|
+
Enabled: true
|
1944
|
+
VersionAdded: '0.75'
|
1887
1945
|
|
1888
1946
|
#################### Naming ##############################
|
1889
1947
|
|
@@ -2065,6 +2123,7 @@ Naming/MethodParameterName:
|
|
2065
2123
|
- ip
|
2066
2124
|
- db
|
2067
2125
|
- os
|
2126
|
+
- pp
|
2068
2127
|
# Forbidden names that will register an offense
|
2069
2128
|
ForbiddenNames: []
|
2070
2129
|
|
@@ -2173,10 +2232,12 @@ Style/AccessModifierDeclarations:
|
|
2173
2232
|
Description: 'Checks style of how access modifiers are used.'
|
2174
2233
|
Enabled: true
|
2175
2234
|
VersionAdded: '0.57'
|
2235
|
+
VersionChanged: '0.81'
|
2176
2236
|
EnforcedStyle: group
|
2177
2237
|
SupportedStyles:
|
2178
2238
|
- inline
|
2179
2239
|
- group
|
2240
|
+
AllowModifiersOnSymbols: true
|
2180
2241
|
|
2181
2242
|
Style/Alias:
|
2182
2243
|
Description: 'Use alias instead of alias_method.'
|
@@ -2355,30 +2416,27 @@ Style/BlockDelimiters:
|
|
2355
2416
|
# # also good
|
2356
2417
|
# collection.each do |element| puts element end
|
2357
2418
|
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
|
2419
|
+
# The BracesRequiredMethods overrides all other configurations except
|
2420
|
+
# IgnoredMethods. It can be used to enforce that all blocks for specific
|
2421
|
+
# methods use braces. For example, you can use this to enforce Sorbet
|
2422
|
+
# signatures use braces even when the rest of your codebase enforces
|
2423
|
+
# the `line_count_based` style.
|
2424
|
+
BracesRequiredMethods: []
|
2376
2425
|
|
2377
2426
|
Style/CaseEquality:
|
2378
2427
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
2379
2428
|
StyleGuide: '#no-case-equality'
|
2380
2429
|
Enabled: true
|
2381
2430
|
VersionAdded: '0.9'
|
2431
|
+
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
|
2432
|
+
# the case equality operator is a constant.
|
2433
|
+
#
|
2434
|
+
# # bad
|
2435
|
+
# /string/ === "string"
|
2436
|
+
#
|
2437
|
+
# # good
|
2438
|
+
# String === "string"
|
2439
|
+
AllowOnConstant: false
|
2382
2440
|
|
2383
2441
|
Style/CharacterLiteral:
|
2384
2442
|
Description: 'Checks for uses of character literals.'
|
@@ -2419,6 +2477,7 @@ Style/ClassAndModuleChildren:
|
|
2419
2477
|
|
2420
2478
|
Style/ClassCheck:
|
2421
2479
|
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
2480
|
+
StyleGuide: '#is-a-vs-kind-of'
|
2422
2481
|
Enabled: true
|
2423
2482
|
VersionAdded: '0.24'
|
2424
2483
|
EnforcedStyle: is_a?
|
@@ -2442,7 +2501,7 @@ Style/ClassVars:
|
|
2442
2501
|
# Align with the style guide.
|
2443
2502
|
Style/CollectionMethods:
|
2444
2503
|
Description: 'Preferred collection methods.'
|
2445
|
-
StyleGuide: '#map-find-select-reduce-size'
|
2504
|
+
StyleGuide: '#map-find-select-reduce-include-size'
|
2446
2505
|
Enabled: false
|
2447
2506
|
VersionAdded: '0.9'
|
2448
2507
|
VersionChanged: '0.27'
|
@@ -2459,6 +2518,7 @@ Style/CollectionMethods:
|
|
2459
2518
|
inject: 'reduce'
|
2460
2519
|
detect: 'find'
|
2461
2520
|
find_all: 'select'
|
2521
|
+
member?: 'include?'
|
2462
2522
|
|
2463
2523
|
Style/ColonMethodCall:
|
2464
2524
|
Description: 'Do not use :: for method call.'
|
@@ -2585,6 +2645,12 @@ Style/Dir:
|
|
2585
2645
|
Enabled: true
|
2586
2646
|
VersionAdded: '0.50'
|
2587
2647
|
|
2648
|
+
Style/DisableCopsWithinSourceCodeDirective:
|
2649
|
+
Description: >-
|
2650
|
+
Forbids disabling/enabling cops within source code.
|
2651
|
+
Enabled: false
|
2652
|
+
VersionAdded: '0.82'
|
2653
|
+
|
2588
2654
|
Style/Documentation:
|
2589
2655
|
Description: 'Document classes and non-namespace modules.'
|
2590
2656
|
Enabled: true
|
@@ -2684,6 +2750,7 @@ Style/EndBlock:
|
|
2684
2750
|
StyleGuide: '#no-END-blocks'
|
2685
2751
|
Enabled: true
|
2686
2752
|
VersionAdded: '0.9'
|
2753
|
+
VersionChanged: '0.81'
|
2687
2754
|
|
2688
2755
|
Style/EvalWithLocation:
|
2689
2756
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
@@ -2702,6 +2769,17 @@ Style/ExpandPathArguments:
|
|
2702
2769
|
Enabled: true
|
2703
2770
|
VersionAdded: '0.53'
|
2704
2771
|
|
2772
|
+
Style/ExponentialNotation:
|
2773
|
+
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
2774
|
+
StyleGuide: '#exponential-notation'
|
2775
|
+
Enabled: pending
|
2776
|
+
VersionAdded: '0.82'
|
2777
|
+
EnforcedStyle: scientific
|
2778
|
+
SupportedStyles:
|
2779
|
+
- scientific
|
2780
|
+
- engineering
|
2781
|
+
- integral
|
2782
|
+
|
2705
2783
|
Style/FloatDivision:
|
2706
2784
|
Description: 'For performing float division, coerce one side only.'
|
2707
2785
|
StyleGuide: '#float-division'
|
@@ -2758,7 +2836,7 @@ Style/FrozenStringLiteralComment:
|
|
2758
2836
|
to help transition to frozen string literals by default.
|
2759
2837
|
Enabled: true
|
2760
2838
|
VersionAdded: '0.36'
|
2761
|
-
VersionChanged: '0.
|
2839
|
+
VersionChanged: '0.79'
|
2762
2840
|
EnforcedStyle: always
|
2763
2841
|
SupportedStyles:
|
2764
2842
|
# `always` will always add the frozen string literal comment to a file
|
@@ -2766,9 +2844,14 @@ Style/FrozenStringLiteralComment:
|
|
2766
2844
|
# string literal. If you run code against multiple versions of Ruby, it is
|
2767
2845
|
# possible that this will create errors in Ruby 2.3.0+.
|
2768
2846
|
- always
|
2847
|
+
# `always_true` will add the frozen string literal comment to a file,
|
2848
|
+
# similarly to the `always` style, but will also change any disabled
|
2849
|
+
# comments (e.g. `# frozen_string_literal: false`) to be enabled.
|
2850
|
+
- always_true
|
2769
2851
|
# `never` will enforce that the frozen string literal comment does not
|
2770
2852
|
# exist in a file.
|
2771
2853
|
- never
|
2854
|
+
Safe: false
|
2772
2855
|
|
2773
2856
|
Style/GlobalVars:
|
2774
2857
|
Description: 'Do not introduce global variables.'
|
@@ -2789,6 +2872,13 @@ Style/GuardClause:
|
|
2789
2872
|
# needs to have to trigger this cop
|
2790
2873
|
MinBodyLength: 1
|
2791
2874
|
|
2875
|
+
Style/HashEachMethods:
|
2876
|
+
Description: 'Use Hash#each_key and Hash#each_value.'
|
2877
|
+
StyleGuide: '#hash-each'
|
2878
|
+
Enabled: pending
|
2879
|
+
VersionAdded: '0.80'
|
2880
|
+
Safe: false
|
2881
|
+
|
2792
2882
|
Style/HashSyntax:
|
2793
2883
|
Description: >-
|
2794
2884
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
@@ -2812,6 +2902,18 @@ Style/HashSyntax:
|
|
2812
2902
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
2813
2903
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
2814
2904
|
|
2905
|
+
Style/HashTransformKeys:
|
2906
|
+
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
2907
|
+
Enabled: 'pending'
|
2908
|
+
VersionAdded: '0.80'
|
2909
|
+
Safe: false
|
2910
|
+
|
2911
|
+
Style/HashTransformValues:
|
2912
|
+
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
2913
|
+
Enabled: 'pending'
|
2914
|
+
VersionAdded: '0.80'
|
2915
|
+
Safe: false
|
2916
|
+
|
2815
2917
|
Style/IdenticalConditionalBranches:
|
2816
2918
|
Description: >-
|
2817
2919
|
Checks that conditional statements do not have an identical
|
@@ -2920,7 +3022,7 @@ Style/LambdaCall:
|
|
2920
3022
|
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
2921
3023
|
StyleGuide: '#proc-call'
|
2922
3024
|
Enabled: true
|
2923
|
-
VersionAdded: '0.13
|
3025
|
+
VersionAdded: '0.13'
|
2924
3026
|
VersionChanged: '0.14'
|
2925
3027
|
EnforcedStyle: call
|
2926
3028
|
SupportedStyles:
|
@@ -3050,6 +3152,7 @@ Style/ModuleFunction:
|
|
3050
3152
|
SupportedStyles:
|
3051
3153
|
- module_function
|
3052
3154
|
- extend_self
|
3155
|
+
- forbidden
|
3053
3156
|
Autocorrect: false
|
3054
3157
|
SafeAutoCorrect: false
|
3055
3158
|
|
@@ -3789,22 +3892,29 @@ Style/TrailingCommaInArrayLiteral:
|
|
3789
3892
|
StyleGuide: '#no-trailing-array-commas'
|
3790
3893
|
Enabled: true
|
3791
3894
|
VersionAdded: '0.53'
|
3895
|
+
# If `comma`, the cop requires a comma after the last item in an array,
|
3792
3896
|
# but only when each item is on its own line.
|
3793
3897
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
3794
|
-
# non-empty array literals.
|
3898
|
+
# non-empty, multiline array literals.
|
3795
3899
|
EnforcedStyleForMultiline: no_comma
|
3796
3900
|
SupportedStylesForMultiline:
|
3797
3901
|
- comma
|
3798
3902
|
- consistent_comma
|
3799
3903
|
- no_comma
|
3800
3904
|
|
3905
|
+
Style/TrailingCommaInBlockArgs:
|
3906
|
+
Description: 'Checks for useless trailing commas in block arguments.'
|
3907
|
+
Enabled: false
|
3908
|
+
Safe: false
|
3909
|
+
VersionAdded: '0.81'
|
3910
|
+
|
3801
3911
|
Style/TrailingCommaInHashLiteral:
|
3802
3912
|
Description: 'Checks for trailing comma in hash literals.'
|
3803
3913
|
Enabled: true
|
3804
3914
|
# If `comma`, the cop requires a comma after the last item in a hash,
|
3805
3915
|
# but only when each item is on its own line.
|
3806
3916
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
3807
|
-
# non-empty hash literals.
|
3917
|
+
# non-empty, multiline hash literals.
|
3808
3918
|
EnforcedStyleForMultiline: no_comma
|
3809
3919
|
SupportedStylesForMultiline:
|
3810
3920
|
- comma
|