rubocop 0.82.0 → 0.86.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -19
- data/config/default.yml +111 -23
- data/lib/rubocop.rb +16 -59
- data/lib/rubocop/ast_aliases.rb +8 -0
- data/lib/rubocop/cli.rb +3 -3
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +2 -2
- data/lib/rubocop/cli/command/init_dotfile.rb +1 -1
- data/lib/rubocop/cli/command/show_cops.rb +2 -6
- data/lib/rubocop/comment_config.rb +1 -1
- data/lib/rubocop/config.rb +6 -2
- data/lib/rubocop/config_loader.rb +19 -24
- data/lib/rubocop/config_loader_resolver.rb +45 -6
- data/lib/rubocop/config_store.rb +12 -2
- data/lib/rubocop/config_validator.rb +2 -1
- data/lib/rubocop/cop/autocorrect_logic.rb +1 -2
- data/lib/rubocop/cop/bundler/gem_comment.rb +70 -1
- data/lib/rubocop/cop/commissioner.rb +0 -21
- data/lib/rubocop/cop/cop.rb +36 -21
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +2 -6
- data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/space_corrector.rb +1 -3
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -3
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +1 -1
- data/lib/rubocop/cop/generator.rb +4 -3
- data/lib/rubocop/cop/generator/configuration_injector.rb +1 -1
- data/lib/rubocop/cop/ignored_node.rb +1 -3
- data/lib/rubocop/cop/layout/case_indentation.rb +3 -3
- data/lib/rubocop/cop/layout/class_structure.rb +19 -16
- data/lib/rubocop/cop/layout/comment_indentation.rb +3 -3
- data/lib/rubocop/cop/layout/condition_position.rb +12 -2
- data/lib/rubocop/cop/layout/empty_comment.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +2 -6
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +128 -0
- data/lib/rubocop/cop/layout/end_of_line.rb +3 -3
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +2 -4
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +1 -3
- data/lib/rubocop/cop/layout/first_array_element_line_break.rb +1 -1
- data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +1 -3
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/hash_alignment.rb +7 -7
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +3 -7
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +20 -103
- data/lib/rubocop/cop/layout/indentation_width.rb +1 -3
- data/lib/rubocop/cop/layout/line_length.rb +21 -18
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -3
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +13 -4
- data/lib/rubocop/cop/layout/space_after_colon.rb +1 -1
- data/lib/rubocop/cop/layout/space_around_keyword.rb +2 -2
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +1 -3
- data/lib/rubocop/cop/layout/space_around_operators.rb +19 -2
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +14 -0
- data/lib/rubocop/cop/layout/space_before_comment.rb +1 -3
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +2 -4
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +2 -2
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +1 -3
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +2 -2
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +41 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +14 -0
- data/lib/rubocop/cop/lint/constant_resolution.rb +89 -0
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +137 -0
- 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 +19 -2
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +1 -3
- data/lib/rubocop/cop/lint/float_out_of_range.rb +1 -1
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +38 -2
- data/lib/rubocop/cop/lint/literal_as_condition.rb +10 -13
- data/lib/rubocop/cop/lint/loop.rb +1 -1
- data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +69 -0
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +1 -1
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +7 -7
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +33 -11
- data/lib/rubocop/cop/lint/percent_string_array.rb +2 -4
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +1 -1
- data/lib/rubocop/cop/lint/raise_exception.rb +12 -4
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +5 -8
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +3 -3
- data/lib/rubocop/cop/lint/regexp_as_condition.rb +6 -0
- data/lib/rubocop/cop/lint/rescue_exception.rb +1 -1
- data/lib/rubocop/cop/lint/safe_navigation_with_empty.rb +1 -1
- data/lib/rubocop/cop/lint/suppressed_exception.rb +11 -4
- data/lib/rubocop/cop/lint/syntax.rb +1 -3
- data/lib/rubocop/cop/lint/unreachable_code.rb +1 -1
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +13 -3
- data/lib/rubocop/cop/lint/useless_assignment.rb +3 -2
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +6 -1
- data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +35 -3
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/iterating_block.rb +61 -0
- data/lib/rubocop/cop/migration/department_name.rb +7 -7
- data/lib/rubocop/cop/mixin/alignment.rb +1 -3
- data/lib/rubocop/cop/mixin/array_min_size.rb +1 -3
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +3 -9
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +1 -3
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +2 -4
- data/lib/rubocop/cop/mixin/configurable_naming.rb +1 -1
- data/lib/rubocop/cop/mixin/documentation_comment.rb +2 -2
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +1 -1
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +10 -1
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +8 -1
- data/lib/rubocop/cop/mixin/ignored_pattern.rb +1 -1
- data/lib/rubocop/cop/mixin/line_length_help.rb +3 -2
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
- data/lib/rubocop/cop/mixin/parentheses.rb +1 -2
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -1
- data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/range_help.rb +1 -1
- data/lib/rubocop/cop/mixin/regexp_literal_help.rb +43 -0
- data/lib/rubocop/cop/mixin/statement_modifier.rb +7 -23
- data/lib/rubocop/cop/mixin/string_literals_help.rb +1 -1
- data/lib/rubocop/cop/mixin/surrounding_space.rb +3 -3
- data/lib/rubocop/cop/mixin/target_ruby_version.rb +5 -1
- data/lib/rubocop/cop/mixin/trailing_comma.rb +2 -4
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +3 -3
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +11 -1
- data/lib/rubocop/cop/naming/file_name.rb +28 -17
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +1 -1
- data/lib/rubocop/cop/naming/method_name.rb +1 -5
- data/lib/rubocop/cop/naming/predicate_name.rb +1 -1
- data/lib/rubocop/cop/registry.rb +63 -10
- data/lib/rubocop/cop/severity.rb +1 -3
- data/lib/rubocop/cop/style/and_or.rb +2 -2
- data/lib/rubocop/cop/style/array_join.rb +1 -1
- data/lib/rubocop/cop/style/attr.rb +1 -3
- data/lib/rubocop/cop/style/bare_percent_literals.rb +2 -2
- data/lib/rubocop/cop/style/block_delimiters.rb +4 -12
- data/lib/rubocop/cop/style/case_equality.rb +1 -1
- data/lib/rubocop/cop/style/class_and_module_children.rb +1 -1
- data/lib/rubocop/cop/style/command_literal.rb +1 -1
- data/lib/rubocop/cop/style/commented_keyword.rb +2 -2
- data/lib/rubocop/cop/style/conditional_assignment.rb +2 -4
- data/lib/rubocop/cop/style/copyright.rb +5 -5
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +1 -1
- data/lib/rubocop/cop/style/documentation.rb +2 -2
- data/lib/rubocop/cop/style/double_negation.rb +41 -4
- data/lib/rubocop/cop/style/empty_case_condition.rb +8 -6
- data/lib/rubocop/cop/style/empty_literal.rb +1 -3
- data/lib/rubocop/cop/style/empty_method.rb +1 -5
- data/lib/rubocop/cop/style/encoding.rb +1 -1
- data/lib/rubocop/cop/style/exponential_notation.rb +5 -5
- data/lib/rubocop/cop/style/format_string_token.rb +2 -3
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +3 -6
- data/lib/rubocop/cop/style/guard_clause.rb +25 -2
- data/lib/rubocop/cop/style/hash_each_methods.rb +1 -1
- data/lib/rubocop/cop/style/hash_syntax.rb +16 -7
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +1 -1
- data/lib/rubocop/cop/style/if_inside_else.rb +1 -1
- data/lib/rubocop/cop/style/if_with_semicolon.rb +16 -0
- data/lib/rubocop/cop/style/inline_comment.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +1 -1
- data/lib/rubocop/cop/style/ip_addresses.rb +1 -1
- data/lib/rubocop/cop/style/lambda_call.rb +0 -20
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +1 -3
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +1 -3
- data/lib/rubocop/cop/style/multiline_if_then.rb +1 -1
- data/lib/rubocop/cop/style/multiline_memoization.rb +1 -1
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +17 -6
- data/lib/rubocop/cop/style/multiline_when_then.rb +16 -1
- data/lib/rubocop/cop/style/negated_if.rb +3 -3
- data/lib/rubocop/cop/style/negated_unless.rb +3 -3
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +27 -0
- data/lib/rubocop/cop/style/next.rb +2 -2
- data/lib/rubocop/cop/style/non_nil_check.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +2 -2
- data/lib/rubocop/cop/style/one_line_conditional.rb +2 -6
- data/lib/rubocop/cop/style/optional_arguments.rb +1 -1
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/style/redundant_conditional.rb +4 -3
- data/lib/rubocop/cop/style/redundant_fetch_block.rb +103 -0
- data/lib/rubocop/cop/style/redundant_parentheses.rb +3 -7
- data/lib/rubocop/cop/style/redundant_percent_q.rb +3 -3
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +89 -0
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +121 -0
- data/lib/rubocop/cop/style/redundant_self.rb +6 -9
- data/lib/rubocop/cop/style/safe_navigation.rb +2 -6
- data/lib/rubocop/cop/style/sample.rb +1 -1
- data/lib/rubocop/cop/style/semicolon.rb +1 -1
- data/lib/rubocop/cop/style/slicing_with_range.rb +39 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +2 -6
- data/lib/rubocop/cop/style/struct_inheritance.rb +21 -0
- data/lib/rubocop/cop/style/symbol_array.rb +5 -5
- data/lib/rubocop/cop/style/ternary_parentheses.rb +2 -4
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +3 -3
- data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +3 -3
- data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +13 -13
- data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +3 -3
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +1 -3
- data/lib/rubocop/cop/style/unless_else.rb +1 -1
- data/lib/rubocop/cop/style/when_then.rb +1 -1
- data/lib/rubocop/cop/style/word_array.rb +1 -1
- data/lib/rubocop/cop/style/yoda_condition.rb +18 -1
- data/lib/rubocop/cop/team.rb +69 -25
- data/lib/rubocop/cop/util.rb +27 -3
- data/lib/rubocop/cop/utils/format_string.rb +18 -0
- data/lib/rubocop/cop/variable_force.rb +3 -9
- data/lib/rubocop/cop/variable_force/assignment.rb +1 -0
- data/lib/rubocop/cop/variable_force/branch.rb +1 -3
- data/lib/rubocop/cop/variable_force/scope.rb +1 -0
- data/lib/rubocop/cop/variable_force/variable.rb +3 -6
- data/lib/rubocop/ext/processed_source.rb +18 -0
- data/lib/rubocop/formatter/base_formatter.rb +0 -4
- data/lib/rubocop/formatter/disabled_config_formatter.rb +5 -13
- data/lib/rubocop/formatter/formatter_set.rb +2 -4
- data/lib/rubocop/formatter/junit_formatter.rb +14 -4
- data/lib/rubocop/magic_comment.rb +1 -1
- data/lib/rubocop/name_similarity.rb +18 -9
- data/lib/rubocop/options.rb +26 -11
- data/lib/rubocop/path_util.rb +2 -2
- data/lib/rubocop/platform.rb +1 -1
- data/lib/rubocop/remote_config.rb +1 -3
- data/lib/rubocop/result_cache.rb +5 -7
- data/lib/rubocop/rspec/cop_helper.rb +2 -25
- data/lib/rubocop/rspec/expect_offense.rb +58 -15
- data/lib/rubocop/rspec/shared_contexts.rb +54 -16
- data/lib/rubocop/runner.rb +20 -13
- data/lib/rubocop/target_finder.rb +8 -8
- data/lib/rubocop/target_ruby.rb +4 -1
- data/lib/rubocop/version.rb +5 -3
- metadata +51 -74
- data/lib/rubocop/ast/builder.rb +0 -85
- data/lib/rubocop/ast/node.rb +0 -637
- data/lib/rubocop/ast/node/alias_node.rb +0 -24
- data/lib/rubocop/ast/node/and_node.rb +0 -29
- data/lib/rubocop/ast/node/args_node.rb +0 -29
- data/lib/rubocop/ast/node/array_node.rb +0 -70
- data/lib/rubocop/ast/node/block_node.rb +0 -121
- data/lib/rubocop/ast/node/break_node.rb +0 -17
- data/lib/rubocop/ast/node/case_match_node.rb +0 -56
- data/lib/rubocop/ast/node/case_node.rb +0 -56
- data/lib/rubocop/ast/node/class_node.rb +0 -31
- data/lib/rubocop/ast/node/def_node.rb +0 -82
- data/lib/rubocop/ast/node/defined_node.rb +0 -17
- data/lib/rubocop/ast/node/ensure_node.rb +0 -17
- data/lib/rubocop/ast/node/float_node.rb +0 -12
- data/lib/rubocop/ast/node/for_node.rb +0 -53
- data/lib/rubocop/ast/node/forward_args_node.rb +0 -18
- data/lib/rubocop/ast/node/hash_node.rb +0 -109
- data/lib/rubocop/ast/node/if_node.rb +0 -175
- data/lib/rubocop/ast/node/int_node.rb +0 -12
- data/lib/rubocop/ast/node/keyword_splat_node.rb +0 -45
- data/lib/rubocop/ast/node/mixin/basic_literal_node.rb +0 -16
- data/lib/rubocop/ast/node/mixin/binary_operator_node.rb +0 -43
- data/lib/rubocop/ast/node/mixin/collection_node.rb +0 -15
- data/lib/rubocop/ast/node/mixin/conditional_node.rb +0 -45
- data/lib/rubocop/ast/node/mixin/hash_element_node.rb +0 -125
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +0 -269
- data/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb +0 -114
- data/lib/rubocop/ast/node/mixin/modifier_node.rb +0 -17
- data/lib/rubocop/ast/node/mixin/numeric_node.rb +0 -21
- data/lib/rubocop/ast/node/mixin/parameterized_node.rb +0 -61
- data/lib/rubocop/ast/node/mixin/predicate_operator_node.rb +0 -35
- data/lib/rubocop/ast/node/module_node.rb +0 -24
- data/lib/rubocop/ast/node/or_node.rb +0 -29
- data/lib/rubocop/ast/node/pair_node.rb +0 -63
- data/lib/rubocop/ast/node/range_node.rb +0 -18
- data/lib/rubocop/ast/node/regexp_node.rb +0 -33
- data/lib/rubocop/ast/node/resbody_node.rb +0 -24
- data/lib/rubocop/ast/node/retry_node.rb +0 -17
- data/lib/rubocop/ast/node/return_node.rb +0 -24
- data/lib/rubocop/ast/node/self_class_node.rb +0 -24
- data/lib/rubocop/ast/node/send_node.rb +0 -13
- data/lib/rubocop/ast/node/str_node.rb +0 -16
- data/lib/rubocop/ast/node/super_node.rb +0 -21
- data/lib/rubocop/ast/node/symbol_node.rb +0 -12
- data/lib/rubocop/ast/node/until_node.rb +0 -35
- data/lib/rubocop/ast/node/when_node.rb +0 -53
- data/lib/rubocop/ast/node/while_node.rb +0 -35
- data/lib/rubocop/ast/node/yield_node.rb +0 -21
- data/lib/rubocop/ast/sexp.rb +0 -16
- data/lib/rubocop/ast/traversal.rb +0 -202
- data/lib/rubocop/node_pattern.rb +0 -887
- data/lib/rubocop/processed_source.rb +0 -213
- data/lib/rubocop/string_util.rb +0 -14
- data/lib/rubocop/token.rb +0 -114
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99c7f4b160b77fafa6fb31562b3fbd206a50b4b5201c918250b1a1d94105fb14
|
4
|
+
data.tar.gz: d709c3614f3aaf536c0acefe88effe53ff51c148e37cc57740890d4ec4abbb50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 966a99e7d38184ccdd1f6b21c14c8d800a6f86488f9685571d60b712088ddac8218f1324e9fc61ddf37d941d6f16b6f6a8a3a1eb6f7c897780e02d1d7994fb15
|
7
|
+
data.tar.gz: 61bc95d25555286a6ed5e4fc710ce97cbd0b1cf7858e8bd876cb42bf1cbb673fde2316917abf5e2f0e89252042b1a4495cb88f5cbc579046052e71a22cef1259
|
data/README.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
+
<p align="center">
|
2
|
+
<img src="https://raw.githubusercontent.com/rubocop-hq/rubocop/master/logo/rubo-logo-horizontal.png" alt="RuboCop Logo"/>
|
3
|
+
</p>
|
4
|
+
|
5
|
+
----------
|
6
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop-hq/rubocop)
|
1
7
|
[![Gem Version](https://badge.fury.io/rb/rubocop.svg)](https://badge.fury.io/rb/rubocop)
|
2
8
|
[![CircleCI Status](https://circleci.com/gh/rubocop-hq/rubocop/tree/master.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop/tree/master)
|
3
|
-
[![
|
4
|
-
[![Coverage
|
5
|
-
[![
|
6
|
-
[![Inline docs](https://inch-ci.org/github/bbatsov/rubocop.svg)](https://inch-ci.org/github/bbatsov/rubocop)
|
9
|
+
[![Actions Status](https://github.com/rubocop-hq/rubocop/workflows/CI/badge.svg?branch=master)](https://github.com/rubocop-hq/rubocop/actions?query=workflow%3ACI)
|
10
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/d2d67f728e88ea84ac69/test_coverage)](https://codeclimate.com/github/rubocop-hq/rubocop/test_coverage)
|
11
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/d2d67f728e88ea84ac69/maintainability)](https://codeclimate.com/github/rubocop-hq/rubocop/maintainability)
|
7
12
|
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rubocop&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=rubocop&package-manager=bundler&version-scheme=semver)
|
8
13
|
|
9
14
|
[![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/bbatsov)
|
@@ -11,26 +16,17 @@
|
|
11
16
|
[![OpenCollective](https://opencollective.com/rubocop/sponsors/badge.svg)](#open-collective-sponsors)
|
12
17
|
[![Tidelift](https://tidelift.com/badges/package/rubygems/rubocop)](https://tidelift.com/subscription/pkg/rubygems-rubocop?utm_source=rubygems-rubocop&utm_medium=referral&utm_campaign=readme)
|
13
18
|
|
14
|
-
<p align="center">
|
15
|
-
<img src="https://raw.githubusercontent.com/rubocop-hq/rubocop/master/logo/rubo-logo-horizontal.png" alt="RuboCop Logo"/>
|
16
|
-
</p>
|
17
|
-
|
18
19
|
> Role models are important. <br/>
|
19
20
|
> -- Officer Alex J. Murphy / RoboCop
|
20
21
|
|
21
|
-
**RuboCop** is a Ruby static code analyzer and code formatter. Out of
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
**RuboCop** is a Ruby static code analyzer (a.k.a. `linter`) and code formatter. Out of the box it
|
23
|
+
will enforce many of the guidelines outlined in the community [Ruby Style
|
24
|
+
Guide](https://rubystyle.guide). Apart from reporting the problems discovered in your code,
|
25
|
+
RuboCop can also automatically fix many of them you.
|
25
26
|
|
26
27
|
RuboCop is extremely flexible and most aspects of its behavior can be tweaked via various
|
27
28
|
[configuration options](https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml).
|
28
29
|
|
29
|
-
Apart from reporting problems in your code, RuboCop can also
|
30
|
-
automatically fix some of the problems for you.
|
31
|
-
|
32
|
-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bbatsov/rubocop?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
33
|
-
|
34
30
|
**Please consider [financially supporting its ongoing development](#funding).**
|
35
31
|
|
36
32
|
## Installation
|
@@ -53,7 +49,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
|
|
53
49
|
might want to use a conservative version lock in your `Gemfile`:
|
54
50
|
|
55
51
|
```rb
|
56
|
-
gem 'rubocop', '~> 0.
|
52
|
+
gem 'rubocop', '~> 0.86.0', require: false
|
57
53
|
```
|
58
54
|
|
59
55
|
## Quickstart
|
@@ -76,6 +72,16 @@ RuboCop supports the following Ruby implementations:
|
|
76
72
|
* MRI 2.4+
|
77
73
|
* JRuby 9.2+
|
78
74
|
|
75
|
+
See [compatibility](https://docs.rubocop.org/rubocop/compatibility.html) for further details.
|
76
|
+
|
77
|
+
## Readme Badge
|
78
|
+
|
79
|
+
If you use RuboCop in your project, you can include one of these badges in your readme to let people know that your code is written following the community Ruby Style Guide.
|
80
|
+
|
81
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop-hq/rubocop)
|
82
|
+
|
83
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://rubystyle.guide)
|
84
|
+
|
79
85
|
## Team
|
80
86
|
|
81
87
|
Here's a list of RuboCop's core developers:
|
@@ -88,6 +94,8 @@ Here's a list of RuboCop's core developers:
|
|
88
94
|
* [Masataka Kuwabara](https://github.com/pocke)
|
89
95
|
* [Koichi Ito](https://github.com/koic)
|
90
96
|
* [Maxim Krizhanovski](https://github.com/darhazer)
|
97
|
+
* [Benjamin Quorning](https://github.com/bquorning)
|
98
|
+
* [Marc-André Lafortune](https://github.com/marcandre)
|
91
99
|
|
92
100
|
## Logo
|
93
101
|
|
@@ -132,7 +140,7 @@ If you're working in a company that's making significant use of RuboCop we'd app
|
|
132
140
|
to become a RuboCop sponsor.
|
133
141
|
|
134
142
|
You can support the development of RuboCop via
|
135
|
-
[
|
143
|
+
[GitHub Sponsors](https://github.com/sponsors/bbatsov),
|
136
144
|
[Patreon](https://www.patreon.com/bbatsov),
|
137
145
|
[PayPal](https://paypal.me/bbatsov)
|
138
146
|
and [Open Collective](https://opencollective.com/rubocop).
|
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,6 +54,7 @@ AllCops:
|
|
53
54
|
- '**/Podfile'
|
54
55
|
- '**/Puppetfile'
|
55
56
|
- '**/Rakefile'
|
57
|
+
- '**/rakefile'
|
56
58
|
- '**/Snapfile'
|
57
59
|
- '**/Steepfile'
|
58
60
|
- '**/Thorfile'
|
@@ -151,12 +153,13 @@ Bundler/GemComment:
|
|
151
153
|
Description: 'Add a comment describing each gem.'
|
152
154
|
Enabled: false
|
153
155
|
VersionAdded: '0.59'
|
154
|
-
VersionChanged: '0.
|
156
|
+
VersionChanged: '0.85'
|
155
157
|
Include:
|
156
158
|
- '**/*.gemfile'
|
157
159
|
- '**/Gemfile'
|
158
160
|
- '**/gems.rb'
|
159
161
|
IgnoredGems: []
|
162
|
+
OnlyFor: []
|
160
163
|
|
161
164
|
Bundler/InsecureProtocolSource:
|
162
165
|
Description: >-
|
@@ -375,6 +378,7 @@ Layout/ConditionPosition:
|
|
375
378
|
StyleGuide: '#same-line-condition'
|
376
379
|
Enabled: true
|
377
380
|
VersionAdded: '0.53'
|
381
|
+
VersionChanged: '0.83'
|
378
382
|
|
379
383
|
Layout/DefEndAlignment:
|
380
384
|
Description: 'Align ends corresponding to defs correctly.'
|
@@ -460,6 +464,19 @@ Layout/EmptyLinesAroundArguments:
|
|
460
464
|
Enabled: true
|
461
465
|
VersionAdded: '0.52'
|
462
466
|
|
467
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
468
|
+
Description: "Keep blank lines around attribute accessors."
|
469
|
+
StyleGuide: '#empty-lines-around-attribute-accessor'
|
470
|
+
Enabled: pending
|
471
|
+
VersionAdded: '0.83'
|
472
|
+
VersionChanged: '0.84'
|
473
|
+
AllowAliasSyntax: true
|
474
|
+
AllowedMethods:
|
475
|
+
- alias_method
|
476
|
+
- public
|
477
|
+
- protected
|
478
|
+
- private
|
479
|
+
|
463
480
|
Layout/EmptyLinesAroundBeginBody:
|
464
481
|
Description: "Keeps track of empty lines around begin-end bodies."
|
465
482
|
StyleGuide: '#empty-lines-around-bodies'
|
@@ -774,13 +791,7 @@ Layout/HeredocIndentation:
|
|
774
791
|
StyleGuide: '#squiggly-heredocs'
|
775
792
|
Enabled: true
|
776
793
|
VersionAdded: '0.49'
|
777
|
-
VersionChanged: '0.
|
778
|
-
EnforcedStyle: squiggly
|
779
|
-
SupportedStyles:
|
780
|
-
- squiggly
|
781
|
-
- active_support
|
782
|
-
- powerpack
|
783
|
-
- unindent
|
794
|
+
VersionChanged: '0.85'
|
784
795
|
|
785
796
|
Layout/IndentationConsistency:
|
786
797
|
Description: 'Keep indentation straight.'
|
@@ -848,13 +859,13 @@ Layout/LeadingEmptyLines:
|
|
848
859
|
VersionChanged: '0.77'
|
849
860
|
|
850
861
|
Layout/LineLength:
|
851
|
-
Description: '
|
852
|
-
StyleGuide: '#
|
862
|
+
Description: 'Checks that line length does not exceed the configured limit.'
|
863
|
+
StyleGuide: '#max-line-length'
|
853
864
|
Enabled: true
|
854
865
|
VersionAdded: '0.25'
|
855
|
-
VersionChanged: '0.
|
866
|
+
VersionChanged: '0.84'
|
856
867
|
AutoCorrect: false
|
857
|
-
Max:
|
868
|
+
Max: 120
|
858
869
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
859
870
|
# containing a URI to be longer than Max.
|
860
871
|
AllowHeredoc: true
|
@@ -1295,8 +1306,8 @@ Layout/TrailingWhitespace:
|
|
1295
1306
|
StyleGuide: '#no-trailing-whitespace'
|
1296
1307
|
Enabled: true
|
1297
1308
|
VersionAdded: '0.49'
|
1298
|
-
VersionChanged: '0.
|
1299
|
-
AllowInHeredoc:
|
1309
|
+
VersionChanged: '0.83'
|
1310
|
+
AllowInHeredoc: true
|
1300
1311
|
|
1301
1312
|
#################### Lint ##################################
|
1302
1313
|
### Warnings
|
@@ -1316,6 +1327,7 @@ Lint/AmbiguousOperator:
|
|
1316
1327
|
StyleGuide: '#method-invocation-parens'
|
1317
1328
|
Enabled: true
|
1318
1329
|
VersionAdded: '0.17'
|
1330
|
+
VersionChanged: '0.83'
|
1319
1331
|
|
1320
1332
|
Lint/AmbiguousRegexpLiteral:
|
1321
1333
|
Description: >-
|
@@ -1323,6 +1335,7 @@ Lint/AmbiguousRegexpLiteral:
|
|
1323
1335
|
a method invocation without parentheses.
|
1324
1336
|
Enabled: true
|
1325
1337
|
VersionAdded: '0.17'
|
1338
|
+
VersionChanged: '0.83'
|
1326
1339
|
|
1327
1340
|
Lint/AssignmentInCondition:
|
1328
1341
|
Description: "Don't use assignment in conditions."
|
@@ -1339,14 +1352,24 @@ Lint/BigDecimalNew:
|
|
1339
1352
|
Lint/BooleanSymbol:
|
1340
1353
|
Description: 'Check for `:true` and `:false` symbols.'
|
1341
1354
|
Enabled: true
|
1355
|
+
Safe: false
|
1342
1356
|
VersionAdded: '0.50'
|
1343
|
-
VersionChanged: '0.
|
1357
|
+
VersionChanged: '0.83'
|
1344
1358
|
|
1345
1359
|
Lint/CircularArgumentReference:
|
1346
1360
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
1347
1361
|
Enabled: true
|
1348
1362
|
VersionAdded: '0.33'
|
1349
1363
|
|
1364
|
+
Lint/ConstantResolution:
|
1365
|
+
Description: 'Check that constants are fully qualified with `::`.'
|
1366
|
+
Enabled: false
|
1367
|
+
VersionAdded: '0.86'
|
1368
|
+
# Restrict this cop to only looking at certain names
|
1369
|
+
Only: []
|
1370
|
+
# Restrict this cop from only looking at certain names
|
1371
|
+
Ignore: []
|
1372
|
+
|
1350
1373
|
Lint/Debugger:
|
1351
1374
|
Description: 'Check for debugger calls.'
|
1352
1375
|
Enabled: true
|
@@ -1358,6 +1381,11 @@ Lint/DeprecatedClassMethods:
|
|
1358
1381
|
Enabled: true
|
1359
1382
|
VersionAdded: '0.19'
|
1360
1383
|
|
1384
|
+
Lint/DeprecatedOpenSSLConstant:
|
1385
|
+
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
1386
|
+
Enabled: pending
|
1387
|
+
VersionAdded: '0.84'
|
1388
|
+
|
1361
1389
|
Lint/DisjunctiveAssignmentInConstructor:
|
1362
1390
|
Description: 'In constructor, plain assignment is preferred over disjunctive.'
|
1363
1391
|
Enabled: true
|
@@ -1411,13 +1439,16 @@ Lint/EmptyInterpolation:
|
|
1411
1439
|
Lint/EmptyWhen:
|
1412
1440
|
Description: 'Checks for `when` branches with empty bodies.'
|
1413
1441
|
Enabled: true
|
1442
|
+
AllowComments: true
|
1414
1443
|
VersionAdded: '0.45'
|
1444
|
+
VersionChanged: '0.83'
|
1415
1445
|
|
1416
1446
|
Lint/EnsureReturn:
|
1417
1447
|
Description: 'Do not use return in an ensure block.'
|
1418
1448
|
StyleGuide: '#no-return-ensure'
|
1419
1449
|
Enabled: true
|
1420
1450
|
VersionAdded: '0.9'
|
1451
|
+
VersionChanged: '0.83'
|
1421
1452
|
|
1422
1453
|
Lint/ErbNewArguments:
|
1423
1454
|
Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
|
@@ -1511,6 +1542,11 @@ Lint/MissingCopEnableDirective:
|
|
1511
1542
|
# .inf for any size
|
1512
1543
|
MaximumRangeSize: .inf
|
1513
1544
|
|
1545
|
+
Lint/MixedRegexpCaptureTypes:
|
1546
|
+
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1547
|
+
Enabled: pending
|
1548
|
+
VersionAdded: '0.85'
|
1549
|
+
|
1514
1550
|
Lint/MultipleComparison:
|
1515
1551
|
Description: "Use `&&` operator to compare multiple values."
|
1516
1552
|
Enabled: true
|
@@ -1565,6 +1601,7 @@ Lint/ParenthesesAsGroupedExpression:
|
|
1565
1601
|
StyleGuide: '#parens-no-spaces'
|
1566
1602
|
Enabled: true
|
1567
1603
|
VersionAdded: '0.12'
|
1604
|
+
VersionChanged: '0.83'
|
1568
1605
|
|
1569
1606
|
Lint/PercentStringArray:
|
1570
1607
|
Description: >-
|
@@ -1583,7 +1620,9 @@ Lint/RaiseException:
|
|
1583
1620
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1584
1621
|
StyleGuide: '#raise-exception'
|
1585
1622
|
Enabled: pending
|
1623
|
+
Safe: false
|
1586
1624
|
VersionAdded: '0.81'
|
1625
|
+
VersionChanged: '0.86'
|
1587
1626
|
AllowedImplicitNamespaces:
|
1588
1627
|
- 'Gem'
|
1589
1628
|
|
@@ -1640,6 +1679,7 @@ Lint/RegexpAsCondition:
|
|
1640
1679
|
The regexp literal matches `$_` implicitly.
|
1641
1680
|
Enabled: true
|
1642
1681
|
VersionAdded: '0.51'
|
1682
|
+
VersionChanged: '0.86'
|
1643
1683
|
|
1644
1684
|
Lint/RequireParentheses:
|
1645
1685
|
Description: >-
|
@@ -1808,7 +1848,7 @@ Lint/UselessAccessModifier:
|
|
1808
1848
|
Description: 'Checks for useless access modifiers.'
|
1809
1849
|
Enabled: true
|
1810
1850
|
VersionAdded: '0.20'
|
1811
|
-
VersionChanged: '0.
|
1851
|
+
VersionChanged: '0.83'
|
1812
1852
|
ContextCreatingMethods: []
|
1813
1853
|
MethodCreatingMethods: []
|
1814
1854
|
|
@@ -1897,7 +1937,7 @@ Metrics/CyclomaticComplexity:
|
|
1897
1937
|
VersionAdded: '0.25'
|
1898
1938
|
VersionChanged: '0.81'
|
1899
1939
|
IgnoredMethods: []
|
1900
|
-
Max:
|
1940
|
+
Max: 7
|
1901
1941
|
|
1902
1942
|
Metrics/MethodLength:
|
1903
1943
|
Description: 'Avoid methods longer than 10 lines of code.'
|
@@ -1983,6 +2023,11 @@ Naming/ClassAndModuleCamelCase:
|
|
1983
2023
|
StyleGuide: '#camelcase-classes'
|
1984
2024
|
Enabled: true
|
1985
2025
|
VersionAdded: '0.50'
|
2026
|
+
VersionChanged: '0.85'
|
2027
|
+
# Allowed class/module names can be specified here.
|
2028
|
+
# These can be full or part of the name.
|
2029
|
+
AllowedNames:
|
2030
|
+
- module_parent
|
1986
2031
|
|
1987
2032
|
Naming/ConstantName:
|
1988
2033
|
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
@@ -2003,6 +2048,10 @@ Naming/FileName:
|
|
2003
2048
|
# It further expects it to be nested inside modules which match the names
|
2004
2049
|
# of subdirectories in its path.
|
2005
2050
|
ExpectMatchingDefinition: false
|
2051
|
+
# When `false`, changes the behavior of ExpectMatchingDefinition to match only
|
2052
|
+
# whether each source file's class or module name matches the file name --
|
2053
|
+
# not whether the nested module hierarchy matches the subdirectory path.
|
2054
|
+
CheckDefinitionPathHierarchy: true
|
2006
2055
|
# If non-`nil`, expect all source file names to match the following regex.
|
2007
2056
|
# Only the file name itself is matched, not the entire file path.
|
2008
2057
|
# Use anchors as necessary if you want to match the entire name rather than
|
@@ -2194,7 +2243,7 @@ Security/JSONLoad:
|
|
2194
2243
|
Description: >-
|
2195
2244
|
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
2196
2245
|
security issues. See reference for more information.
|
2197
|
-
Reference: 'https://ruby-doc.org/stdlib-2.
|
2246
|
+
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
2198
2247
|
Enabled: true
|
2199
2248
|
VersionAdded: '0.43'
|
2200
2249
|
VersionChanged: '0.44'
|
@@ -2207,7 +2256,7 @@ Security/MarshalLoad:
|
|
2207
2256
|
Description: >-
|
2208
2257
|
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
|
2209
2258
|
security issues. See reference for more information.
|
2210
|
-
Reference: 'https://ruby-doc.org/core-2.
|
2259
|
+
Reference: 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
|
2211
2260
|
Enabled: true
|
2212
2261
|
VersionAdded: '0.47'
|
2213
2262
|
|
@@ -2221,7 +2270,7 @@ Security/YAMLLoad:
|
|
2221
2270
|
Description: >-
|
2222
2271
|
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
|
2223
2272
|
security issues. See reference for more information.
|
2224
|
-
Reference: 'https://ruby-doc.org/stdlib-2.
|
2273
|
+
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
|
2225
2274
|
Enabled: true
|
2226
2275
|
VersionAdded: '0.47'
|
2227
2276
|
SafeAutoCorrect: false
|
@@ -2258,7 +2307,7 @@ Style/AndOr:
|
|
2258
2307
|
VersionChanged: '0.25'
|
2259
2308
|
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
2260
2309
|
# or completely (always).
|
2261
|
-
EnforcedStyle:
|
2310
|
+
EnforcedStyle: conditionals
|
2262
2311
|
SupportedStyles:
|
2263
2312
|
- always
|
2264
2313
|
- conditionals
|
@@ -2678,6 +2727,11 @@ Style/DoubleNegation:
|
|
2678
2727
|
StyleGuide: '#no-bang-bang'
|
2679
2728
|
Enabled: true
|
2680
2729
|
VersionAdded: '0.19'
|
2730
|
+
VersionChanged: '0.84'
|
2731
|
+
EnforcedStyle: allowed_in_returns
|
2732
|
+
SupportedStyles:
|
2733
|
+
- allowed_in_returns
|
2734
|
+
- forbidden
|
2681
2735
|
|
2682
2736
|
Style/EachForSimpleLoop:
|
2683
2737
|
Description: >-
|
@@ -2841,8 +2895,7 @@ Style/FrozenStringLiteralComment:
|
|
2841
2895
|
SupportedStyles:
|
2842
2896
|
# `always` will always add the frozen string literal comment to a file
|
2843
2897
|
# regardless of the Ruby version or if `freeze` or `<<` are called on a
|
2844
|
-
# string literal.
|
2845
|
-
# possible that this will create errors in Ruby 2.3.0+.
|
2898
|
+
# string literal. It is possible that this will create errors.
|
2846
2899
|
- always
|
2847
2900
|
# `always_true` will add the frozen string literal comment to a file,
|
2848
2901
|
# similarly to the `always` style, but will also change any disabled
|
@@ -2948,6 +3001,7 @@ Style/IfWithSemicolon:
|
|
2948
3001
|
StyleGuide: '#no-semicolon-ifs'
|
2949
3002
|
Enabled: true
|
2950
3003
|
VersionAdded: '0.9'
|
3004
|
+
VersionChanged: '0.83'
|
2951
3005
|
|
2952
3006
|
Style/ImplicitRuntimeError:
|
2953
3007
|
Description: >-
|
@@ -3197,6 +3251,7 @@ Style/MultilineTernaryOperator:
|
|
3197
3251
|
StyleGuide: '#no-multiline-ternary'
|
3198
3252
|
Enabled: true
|
3199
3253
|
VersionAdded: '0.9'
|
3254
|
+
VersionChanged: '0.86'
|
3200
3255
|
|
3201
3256
|
Style/MultilineWhenThen:
|
3202
3257
|
Description: 'Do not use then for multi-line when statement.'
|
@@ -3301,6 +3356,7 @@ Style/NestedTernaryOperator:
|
|
3301
3356
|
StyleGuide: '#no-nested-ternary'
|
3302
3357
|
Enabled: true
|
3303
3358
|
VersionAdded: '0.9'
|
3359
|
+
VersionChanged: '0.86'
|
3304
3360
|
|
3305
3361
|
Style/Next:
|
3306
3362
|
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
@@ -3425,7 +3481,9 @@ Style/OptionalArguments:
|
|
3425
3481
|
of the argument list.
|
3426
3482
|
StyleGuide: '#optional-arguments'
|
3427
3483
|
Enabled: true
|
3484
|
+
Safe: false
|
3428
3485
|
VersionAdded: '0.33'
|
3486
|
+
VersionChanged: '0.83'
|
3429
3487
|
|
3430
3488
|
Style/OrAssignment:
|
3431
3489
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
@@ -3552,6 +3610,19 @@ Style/RedundantException:
|
|
3552
3610
|
VersionAdded: '0.14'
|
3553
3611
|
VersionChanged: '0.29'
|
3554
3612
|
|
3613
|
+
Style/RedundantFetchBlock:
|
3614
|
+
Description: >-
|
3615
|
+
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
3616
|
+
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
3617
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
3618
|
+
Enabled: 'pending'
|
3619
|
+
Safe: false
|
3620
|
+
# If enabled, this cop will autocorrect usages of
|
3621
|
+
# `fetch` being called with block returning a constant.
|
3622
|
+
# This can be dangerous since constants will not be defined at that moment.
|
3623
|
+
SafeForConstants: false
|
3624
|
+
VersionAdded: '0.86'
|
3625
|
+
|
3555
3626
|
Style/RedundantFreeze:
|
3556
3627
|
Description: "Checks usages of Object#freeze on immutable objects."
|
3557
3628
|
Enabled: true
|
@@ -3574,6 +3645,16 @@ Style/RedundantPercentQ:
|
|
3574
3645
|
Enabled: true
|
3575
3646
|
VersionAdded: '0.76'
|
3576
3647
|
|
3648
|
+
Style/RedundantRegexpCharacterClass:
|
3649
|
+
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
3650
|
+
Enabled: pending
|
3651
|
+
VersionAdded: '0.85'
|
3652
|
+
|
3653
|
+
Style/RedundantRegexpEscape:
|
3654
|
+
Description: 'Checks for redundant escapes in Regexps.'
|
3655
|
+
Enabled: pending
|
3656
|
+
VersionAdded: '0.85'
|
3657
|
+
|
3577
3658
|
Style/RedundantReturn:
|
3578
3659
|
Description: "Don't use return where it's not required."
|
3579
3660
|
StyleGuide: '#no-explicit-return'
|
@@ -3730,6 +3811,12 @@ Style/SingleLineMethods:
|
|
3730
3811
|
VersionChanged: '0.19'
|
3731
3812
|
AllowIfMethodIsEmpty: true
|
3732
3813
|
|
3814
|
+
Style/SlicingWithRange:
|
3815
|
+
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
3816
|
+
Enabled: pending
|
3817
|
+
VersionAdded: '0.83'
|
3818
|
+
Safe: false
|
3819
|
+
|
3733
3820
|
Style/SpecialGlobalVars:
|
3734
3821
|
Description: 'Avoid Perl-style global variables.'
|
3735
3822
|
StyleGuide: '#no-cryptic-perlisms'
|
@@ -3815,6 +3902,7 @@ Style/StructInheritance:
|
|
3815
3902
|
StyleGuide: '#no-extend-struct-new'
|
3816
3903
|
Enabled: true
|
3817
3904
|
VersionAdded: '0.29'
|
3905
|
+
VersionChanged: '0.86'
|
3818
3906
|
|
3819
3907
|
Style/SymbolArray:
|
3820
3908
|
Description: 'Use %i or %I for arrays of symbols.'
|