rubocop 1.72.1 → 1.81.7
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/README.md +22 -18
- data/config/default.yml +240 -65
- data/config/internal_affairs.yml +20 -0
- data/config/obsoletion.yml +8 -3
- data/exe/rubocop +1 -8
- data/lib/rubocop/cli/command/auto_generate_config.rb +2 -2
- data/lib/rubocop/cli.rb +19 -4
- data/lib/rubocop/config.rb +35 -6
- data/lib/rubocop/config_loader.rb +8 -40
- data/lib/rubocop/config_loader_resolver.rb +9 -7
- data/lib/rubocop/config_obsoletion/extracted_cop.rb +4 -3
- data/lib/rubocop/config_obsoletion/renamed_cop.rb +18 -3
- data/lib/rubocop/config_obsoletion.rb +46 -2
- data/lib/rubocop/config_store.rb +5 -0
- data/lib/rubocop/config_validator.rb +7 -6
- data/lib/rubocop/cop/autocorrect_logic.rb +22 -14
- data/lib/rubocop/cop/bundler/ordered_gems.rb +1 -1
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +7 -4
- data/lib/rubocop/cop/correctors/for_to_each_corrector.rb +7 -2
- data/lib/rubocop/cop/correctors/parentheses_corrector.rb +5 -2
- data/lib/rubocop/cop/gemspec/attribute_assignment.rb +91 -0
- data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +37 -15
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -1
- data/lib/rubocop/cop/gemspec/require_mfa.rb +15 -1
- data/lib/rubocop/cop/internal_affairs/example_description.rb +9 -5
- data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +4 -4
- data/lib/rubocop/cop/internal_affairs/node_pattern_groups.rb +6 -2
- data/lib/rubocop/cop/internal_affairs/node_type_group.rb +92 -0
- data/lib/rubocop/cop/internal_affairs/on_send_without_on_csend.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb +6 -5
- data/lib/rubocop/cop/internal_affairs/undefined_config.rb +6 -1
- data/lib/rubocop/cop/internal_affairs/useless_restrict_on_send.rb +1 -1
- data/lib/rubocop/cop/internal_affairs.rb +1 -0
- data/lib/rubocop/cop/layout/block_alignment.rb +2 -2
- data/lib/rubocop/cop/layout/block_end_newline.rb +1 -0
- data/lib/rubocop/cop/layout/class_structure.rb +36 -1
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +5 -5
- data/lib/rubocop/cop/layout/def_end_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/dot_position.rb +1 -1
- data/lib/rubocop/cop/layout/else_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +1 -1
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +32 -14
- data/lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb +101 -0
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +34 -4
- data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +8 -29
- data/lib/rubocop/cop/layout/empty_lines_around_block_body.rb +1 -0
- data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +1 -1
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/hash_alignment.rb +4 -7
- data/lib/rubocop/cop/layout/indentation_width.rb +1 -0
- data/lib/rubocop/cop/layout/leading_comment_space.rb +13 -1
- data/lib/rubocop/cop/layout/line_length.rb +43 -10
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -0
- data/lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb +1 -0
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +9 -5
- data/lib/rubocop/cop/layout/redundant_line_break.rb +9 -5
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +11 -5
- data/lib/rubocop/cop/layout/space_after_semicolon.rb +10 -0
- data/lib/rubocop/cop/layout/space_around_keyword.rb +6 -1
- data/lib/rubocop/cop/layout/space_around_operators.rb +12 -1
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +1 -0
- data/lib/rubocop/cop/layout/space_before_brackets.rb +5 -38
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +12 -3
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +1 -0
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +3 -0
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +1 -1
- data/lib/rubocop/cop/lint/ambiguous_range.rb +5 -0
- data/lib/rubocop/cop/lint/array_literal_in_regexp.rb +2 -3
- data/lib/rubocop/cop/lint/boolean_symbol.rb +1 -1
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +2 -5
- data/lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb +3 -2
- data/lib/rubocop/cop/lint/cop_directive_syntax.rb +13 -7
- data/lib/rubocop/cop/lint/debugger.rb +2 -4
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +1 -1
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +5 -2
- data/lib/rubocop/cop/lint/duplicate_methods.rb +111 -23
- data/lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb +5 -42
- data/lib/rubocop/cop/lint/empty_conditional_body.rb +14 -64
- data/lib/rubocop/cop/lint/empty_interpolation.rb +14 -1
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +0 -6
- data/lib/rubocop/cop/lint/float_comparison.rb +32 -10
- data/lib/rubocop/cop/lint/identity_comparison.rb +19 -15
- data/lib/rubocop/cop/lint/literal_as_condition.rb +124 -10
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +17 -8
- data/lib/rubocop/cop/lint/mixed_case_range.rb +2 -2
- data/lib/rubocop/cop/lint/nested_method_definition.rb +1 -1
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +3 -3
- data/lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb +1 -0
- data/lib/rubocop/cop/lint/or_assignment_to_constant.rb +1 -1
- data/lib/rubocop/cop/lint/raise_exception.rb +29 -10
- data/lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb +1 -1
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +0 -21
- data/lib/rubocop/cop/lint/redundant_safe_navigation.rb +101 -2
- data/lib/rubocop/cop/lint/redundant_type_conversion.rb +43 -13
- data/lib/rubocop/cop/lint/redundant_with_index.rb +3 -0
- data/lib/rubocop/cop/lint/redundant_with_object.rb +3 -0
- data/lib/rubocop/cop/lint/require_range_parentheses.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_exception.rb +1 -4
- data/lib/rubocop/cop/lint/rescue_type.rb +1 -1
- data/lib/rubocop/cop/lint/return_in_void_context.rb +9 -11
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +4 -4
- data/lib/rubocop/cop/lint/self_assignment.rb +31 -5
- data/lib/rubocop/cop/lint/shadowed_argument.rb +7 -7
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +13 -1
- data/lib/rubocop/cop/lint/shared_mutable_default.rb +12 -1
- data/lib/rubocop/cop/lint/suppressed_exception.rb +1 -1
- data/lib/rubocop/cop/lint/to_enum_arguments.rb +1 -1
- data/lib/rubocop/cop/lint/top_level_return_with_argument.rb +1 -1
- data/lib/rubocop/cop/lint/unexpected_block_arity.rb +2 -0
- data/lib/rubocop/cop/lint/unreachable_code.rb +1 -0
- data/lib/rubocop/cop/lint/unreachable_loop.rb +5 -5
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +2 -0
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +30 -4
- data/lib/rubocop/cop/lint/useless_assignment.rb +2 -0
- data/lib/rubocop/cop/lint/useless_constant_scoping.rb +9 -12
- data/lib/rubocop/cop/lint/useless_default_value_argument.rb +90 -0
- data/lib/rubocop/cop/lint/useless_numeric_operation.rb +1 -0
- data/lib/rubocop/cop/lint/useless_or.rb +98 -0
- data/lib/rubocop/cop/lint/useless_rescue.rb +1 -1
- data/lib/rubocop/cop/lint/useless_ruby2_keywords.rb +3 -3
- data/lib/rubocop/cop/lint/utils/nil_receiver_checker.rb +121 -0
- data/lib/rubocop/cop/lint/void.rb +16 -2
- data/lib/rubocop/cop/message_annotator.rb +7 -3
- data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
- data/lib/rubocop/cop/metrics/block_length.rb +1 -0
- data/lib/rubocop/cop/metrics/method_length.rb +1 -0
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
- data/lib/rubocop/cop/mixin/alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/allowed_pattern.rb +4 -4
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +3 -3
- data/lib/rubocop/cop/mixin/check_single_line_suitability.rb +2 -2
- data/lib/rubocop/cop/mixin/def_node.rb +1 -1
- data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +1 -1
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -7
- data/lib/rubocop/cop/mixin/forbidden_identifiers.rb +20 -0
- data/lib/rubocop/cop/mixin/forbidden_pattern.rb +16 -0
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +1 -2
- data/lib/rubocop/cop/mixin/gemspec_help.rb +22 -0
- data/lib/rubocop/cop/mixin/hash_alignment_styles.rb +15 -14
- data/lib/rubocop/cop/mixin/hash_subset.rb +19 -4
- data/lib/rubocop/cop/mixin/line_length_help.rb +24 -8
- data/lib/rubocop/cop/mixin/method_complexity.rb +1 -0
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +2 -0
- data/lib/rubocop/cop/mixin/ordered_gem_node.rb +1 -1
- data/lib/rubocop/cop/mixin/range_help.rb +12 -0
- data/lib/rubocop/cop/mixin/target_ruby_version.rb +1 -1
- data/lib/rubocop/cop/mixin/trailing_comma.rb +18 -2
- data/lib/rubocop/cop/naming/block_forwarding.rb +3 -3
- data/lib/rubocop/cop/naming/file_name.rb +2 -2
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +1 -1
- data/lib/rubocop/cop/naming/method_name.rb +187 -15
- data/lib/rubocop/cop/naming/predicate_method.rb +319 -0
- data/lib/rubocop/cop/naming/{predicate_name.rb → predicate_prefix.rb} +4 -4
- data/lib/rubocop/cop/naming/variable_name.rb +51 -6
- data/lib/rubocop/cop/registry.rb +9 -6
- data/lib/rubocop/cop/security/eval.rb +2 -1
- data/lib/rubocop/cop/security/json_load.rb +33 -11
- data/lib/rubocop/cop/security/open.rb +1 -0
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +32 -10
- data/lib/rubocop/cop/style/accessor_grouping.rb +32 -6
- data/lib/rubocop/cop/style/arguments_forwarding.rb +21 -24
- data/lib/rubocop/cop/style/array_intersect.rb +113 -38
- data/lib/rubocop/cop/style/array_intersect_with_single_element.rb +47 -0
- data/lib/rubocop/cop/style/bitwise_predicate.rb +8 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +3 -2
- data/lib/rubocop/cop/style/case_like_if.rb +1 -1
- data/lib/rubocop/cop/style/class_and_module_children.rb +48 -10
- data/lib/rubocop/cop/style/class_equality_comparison.rb +1 -1
- data/lib/rubocop/cop/style/collection_methods.rb +1 -0
- data/lib/rubocop/cop/style/collection_querying.rb +167 -0
- data/lib/rubocop/cop/style/combinable_loops.rb +1 -0
- data/lib/rubocop/cop/style/command_literal.rb +1 -1
- data/lib/rubocop/cop/style/commented_keyword.rb +12 -5
- data/lib/rubocop/cop/style/comparable_between.rb +78 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +26 -8
- data/lib/rubocop/cop/style/constant_visibility.rb +14 -9
- data/lib/rubocop/cop/style/data_inheritance.rb +7 -0
- data/lib/rubocop/cop/style/def_with_parentheses.rb +18 -5
- data/lib/rubocop/cop/style/dig_chain.rb +1 -1
- data/lib/rubocop/cop/style/double_negation.rb +3 -3
- data/lib/rubocop/cop/style/empty_literal.rb +4 -0
- data/lib/rubocop/cop/style/empty_string_inside_interpolation.rb +100 -0
- data/lib/rubocop/cop/style/endless_method.rb +176 -18
- data/lib/rubocop/cop/style/eval_with_location.rb +3 -3
- data/lib/rubocop/cop/style/expand_path_arguments.rb +2 -7
- data/lib/rubocop/cop/style/explicit_block_argument.rb +3 -3
- data/lib/rubocop/cop/style/exponential_notation.rb +5 -4
- data/lib/rubocop/cop/style/fetch_env_var.rb +32 -6
- data/lib/rubocop/cop/style/float_division.rb +15 -1
- data/lib/rubocop/cop/style/for.rb +1 -0
- data/lib/rubocop/cop/style/format_string_token.rb +38 -11
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +3 -2
- data/lib/rubocop/cop/style/global_std_stream.rb +3 -0
- data/lib/rubocop/cop/style/guard_clause.rb +2 -1
- data/lib/rubocop/cop/style/hash_conversion.rb +16 -8
- data/lib/rubocop/cop/style/hash_each_methods.rb +3 -2
- data/lib/rubocop/cop/style/hash_fetch_chain.rb +104 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +4 -1
- data/lib/rubocop/cop/style/hash_transform_keys.rb +2 -2
- data/lib/rubocop/cop/style/hash_transform_values.rb +2 -2
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +3 -3
- data/lib/rubocop/cop/style/if_inside_else.rb +10 -13
- data/lib/rubocop/cop/style/if_unless_modifier.rb +35 -8
- data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +4 -7
- data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +1 -1
- data/lib/rubocop/cop/style/infinite_loop.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +10 -6
- data/lib/rubocop/cop/style/invertible_unless_condition.rb +2 -2
- data/lib/rubocop/cop/style/ip_addresses.rb +2 -2
- data/lib/rubocop/cop/style/it_assignment.rb +69 -12
- data/lib/rubocop/cop/style/it_block_parameter.rb +121 -0
- data/lib/rubocop/cop/style/keyword_parameters_order.rb +13 -7
- data/lib/rubocop/cop/style/lambda.rb +1 -0
- data/lib/rubocop/cop/style/lambda_call.rb +7 -2
- data/lib/rubocop/cop/style/line_end_concatenation.rb +10 -4
- data/lib/rubocop/cop/style/map_into_array.rb +4 -1
- data/lib/rubocop/cop/style/map_to_hash.rb +12 -3
- data/lib/rubocop/cop/style/map_to_set.rb +1 -3
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +9 -8
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +16 -0
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +2 -1
- data/lib/rubocop/cop/style/min_max_comparison.rb +13 -5
- data/lib/rubocop/cop/style/multiline_block_chain.rb +2 -1
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +2 -0
- data/lib/rubocop/cop/style/multiline_method_signature.rb +1 -9
- data/lib/rubocop/cop/style/next.rb +44 -0
- data/lib/rubocop/cop/style/nil_comparison.rb +9 -7
- data/lib/rubocop/cop/style/object_then.rb +1 -0
- data/lib/rubocop/cop/style/one_line_conditional.rb +17 -9
- data/lib/rubocop/cop/style/parallel_assignment.rb +32 -20
- data/lib/rubocop/cop/style/percent_q_literals.rb +1 -1
- data/lib/rubocop/cop/style/proc.rb +1 -0
- data/lib/rubocop/cop/style/raise_args.rb +8 -8
- data/lib/rubocop/cop/style/redundant_array_flatten.rb +50 -0
- data/lib/rubocop/cop/style/redundant_begin.rb +35 -0
- data/lib/rubocop/cop/style/redundant_condition.rb +57 -0
- data/lib/rubocop/cop/style/redundant_current_directory_in_path.rb +14 -4
- data/lib/rubocop/cop/style/redundant_exception.rb +1 -1
- data/lib/rubocop/cop/style/redundant_fetch_block.rb +1 -9
- data/lib/rubocop/cop/style/redundant_format.rb +79 -18
- data/lib/rubocop/cop/style/redundant_freeze.rb +2 -2
- data/lib/rubocop/cop/style/redundant_interpolation.rb +12 -3
- data/lib/rubocop/cop/style/redundant_line_continuation.rb +1 -4
- data/lib/rubocop/cop/style/redundant_parentheses.rb +73 -18
- data/lib/rubocop/cop/style/redundant_regexp_argument.rb +4 -0
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +8 -0
- data/lib/rubocop/cop/style/redundant_self.rb +9 -5
- data/lib/rubocop/cop/style/redundant_self_assignment.rb +1 -1
- data/lib/rubocop/cop/style/redundant_sort_by.rb +17 -1
- data/lib/rubocop/cop/style/regexp_literal.rb +1 -1
- data/lib/rubocop/cop/style/rescue_modifier.rb +3 -0
- data/lib/rubocop/cop/style/return_nil.rb +2 -2
- data/lib/rubocop/cop/style/safe_navigation.rb +61 -14
- data/lib/rubocop/cop/style/select_by_regexp.rb +4 -1
- data/lib/rubocop/cop/style/semicolon.rb +23 -7
- data/lib/rubocop/cop/style/single_line_do_end_block.rb +3 -1
- data/lib/rubocop/cop/style/single_line_methods.rb +10 -7
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +75 -101
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/string_concatenation.rb +18 -15
- data/lib/rubocop/cop/style/struct_inheritance.rb +8 -1
- data/lib/rubocop/cop/style/super_arguments.rb +1 -2
- data/lib/rubocop/cop/style/symbol_array.rb +1 -1
- data/lib/rubocop/cop/style/symbol_proc.rb +3 -1
- data/lib/rubocop/cop/style/top_level_method_definition.rb +1 -0
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +52 -1
- data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +47 -6
- data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +1 -1
- data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +48 -6
- data/lib/rubocop/cop/style/trivial_accessors.rb +1 -1
- data/lib/rubocop/cop/style/unless_else.rb +10 -9
- data/lib/rubocop/cop/team.rb +1 -1
- data/lib/rubocop/cop/util.rb +1 -1
- data/lib/rubocop/cop/utils/format_string.rb +15 -2
- data/lib/rubocop/cop/variable_force/assignment.rb +7 -3
- data/lib/rubocop/cop/variable_force/scope.rb +1 -1
- data/lib/rubocop/cop/variable_force/variable.rb +3 -8
- data/lib/rubocop/cop/variable_force.rb +26 -9
- data/lib/rubocop/cops_documentation_generator.rb +23 -7
- data/lib/rubocop/directive_comment.rb +1 -1
- data/lib/rubocop/ext/regexp_node.rb +0 -1
- data/lib/rubocop/formatter/disabled_config_formatter.rb +19 -5
- data/lib/rubocop/formatter/fuubar_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/html_formatter.rb +1 -1
- data/lib/rubocop/formatter/markdown_formatter.rb +1 -0
- data/lib/rubocop/formatter/offense_count_formatter.rb +1 -1
- data/lib/rubocop/formatter/pacman_formatter.rb +2 -1
- data/lib/rubocop/lsp/diagnostic.rb +25 -24
- data/lib/rubocop/lsp/routes.rb +65 -9
- data/lib/rubocop/lsp/runtime.rb +5 -5
- data/lib/rubocop/lsp/server.rb +2 -2
- data/lib/rubocop/lsp/stdin_runner.rb +3 -17
- data/lib/rubocop/magic_comment.rb +8 -0
- data/lib/rubocop/pending_cops_reporter.rb +56 -0
- data/lib/rubocop/plugin/configuration_integrator.rb +2 -0
- data/lib/rubocop/plugin/load_error.rb +1 -1
- data/lib/rubocop/plugin.rb +9 -2
- data/lib/rubocop/result_cache.rb +14 -12
- data/lib/rubocop/rspec/cop_helper.rb +6 -1
- data/lib/rubocop/rspec/expect_offense.rb +9 -3
- data/lib/rubocop/rspec/shared_contexts.rb +34 -0
- data/lib/rubocop/rspec/support.rb +3 -0
- data/lib/rubocop/runner.rb +10 -4
- data/lib/rubocop/server/cache.rb +17 -12
- data/lib/rubocop/server/client_command/base.rb +10 -0
- data/lib/rubocop/server/client_command/exec.rb +2 -1
- data/lib/rubocop/server/client_command/start.rb +11 -1
- data/lib/rubocop/target_finder.rb +13 -9
- data/lib/rubocop/target_ruby.rb +11 -2
- data/lib/rubocop/version.rb +14 -7
- data/lib/rubocop.rb +17 -2
- data/lib/ruby_lsp/rubocop/addon.rb +25 -10
- data/lib/ruby_lsp/rubocop/runtime_adapter.rb +57 -5
- metadata +24 -8
- data/lib/rubocop/cop/utils/regexp_ranges.rb +0 -113
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.81.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bozhidar Batsov
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
- Yuji Nakayama
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2025-
|
|
12
|
+
date: 2025-10-31 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: json
|
|
@@ -127,7 +127,7 @@ dependencies:
|
|
|
127
127
|
requirements:
|
|
128
128
|
- - ">="
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: 1.
|
|
130
|
+
version: 1.47.1
|
|
131
131
|
- - "<"
|
|
132
132
|
- !ruby/object:Gem::Version
|
|
133
133
|
version: '2.0'
|
|
@@ -137,7 +137,7 @@ dependencies:
|
|
|
137
137
|
requirements:
|
|
138
138
|
- - ">="
|
|
139
139
|
- !ruby/object:Gem::Version
|
|
140
|
-
version: 1.
|
|
140
|
+
version: 1.47.1
|
|
141
141
|
- - "<"
|
|
142
142
|
- !ruby/object:Gem::Version
|
|
143
143
|
version: '2.0'
|
|
@@ -265,6 +265,7 @@ files:
|
|
|
265
265
|
- lib/rubocop/cop/exclude_limit.rb
|
|
266
266
|
- lib/rubocop/cop/force.rb
|
|
267
267
|
- lib/rubocop/cop/gemspec/add_runtime_dependency.rb
|
|
268
|
+
- lib/rubocop/cop/gemspec/attribute_assignment.rb
|
|
268
269
|
- lib/rubocop/cop/gemspec/dependency_version.rb
|
|
269
270
|
- lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb
|
|
270
271
|
- lib/rubocop/cop/gemspec/development_dependencies.rb
|
|
@@ -297,6 +298,7 @@ files:
|
|
|
297
298
|
- lib/rubocop/cop/internal_affairs/node_pattern_groups.rb
|
|
298
299
|
- lib/rubocop/cop/internal_affairs/node_pattern_groups/ast_processor.rb
|
|
299
300
|
- lib/rubocop/cop/internal_affairs/node_pattern_groups/ast_walker.rb
|
|
301
|
+
- lib/rubocop/cop/internal_affairs/node_type_group.rb
|
|
300
302
|
- lib/rubocop/cop/internal_affairs/node_type_multiple_predicates.rb
|
|
301
303
|
- lib/rubocop/cop/internal_affairs/node_type_predicate.rb
|
|
302
304
|
- lib/rubocop/cop/internal_affairs/numblock_handler.rb
|
|
@@ -340,6 +342,7 @@ files:
|
|
|
340
342
|
- lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb
|
|
341
343
|
- lib/rubocop/cop/layout/empty_line_between_defs.rb
|
|
342
344
|
- lib/rubocop/cop/layout/empty_lines.rb
|
|
345
|
+
- lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb
|
|
343
346
|
- lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb
|
|
344
347
|
- lib/rubocop/cop/layout/empty_lines_around_arguments.rb
|
|
345
348
|
- lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb
|
|
@@ -560,14 +563,17 @@ files:
|
|
|
560
563
|
- lib/rubocop/cop/lint/useless_access_modifier.rb
|
|
561
564
|
- lib/rubocop/cop/lint/useless_assignment.rb
|
|
562
565
|
- lib/rubocop/cop/lint/useless_constant_scoping.rb
|
|
566
|
+
- lib/rubocop/cop/lint/useless_default_value_argument.rb
|
|
563
567
|
- lib/rubocop/cop/lint/useless_defined.rb
|
|
564
568
|
- lib/rubocop/cop/lint/useless_else_without_rescue.rb
|
|
565
569
|
- lib/rubocop/cop/lint/useless_method_definition.rb
|
|
566
570
|
- lib/rubocop/cop/lint/useless_numeric_operation.rb
|
|
571
|
+
- lib/rubocop/cop/lint/useless_or.rb
|
|
567
572
|
- lib/rubocop/cop/lint/useless_rescue.rb
|
|
568
573
|
- lib/rubocop/cop/lint/useless_ruby2_keywords.rb
|
|
569
574
|
- lib/rubocop/cop/lint/useless_setter_call.rb
|
|
570
575
|
- lib/rubocop/cop/lint/useless_times.rb
|
|
576
|
+
- lib/rubocop/cop/lint/utils/nil_receiver_checker.rb
|
|
571
577
|
- lib/rubocop/cop/lint/void.rb
|
|
572
578
|
- lib/rubocop/cop/message_annotator.rb
|
|
573
579
|
- lib/rubocop/cop/metrics/abc_size.rb
|
|
@@ -615,6 +621,8 @@ files:
|
|
|
615
621
|
- lib/rubocop/cop/mixin/endless_method_rewriter.rb
|
|
616
622
|
- lib/rubocop/cop/mixin/enforce_superclass.rb
|
|
617
623
|
- lib/rubocop/cop/mixin/first_element_line_break.rb
|
|
624
|
+
- lib/rubocop/cop/mixin/forbidden_identifiers.rb
|
|
625
|
+
- lib/rubocop/cop/mixin/forbidden_pattern.rb
|
|
618
626
|
- lib/rubocop/cop/mixin/frozen_string_literal.rb
|
|
619
627
|
- lib/rubocop/cop/mixin/gem_declaration.rb
|
|
620
628
|
- lib/rubocop/cop/mixin/gemspec_help.rb
|
|
@@ -676,7 +684,8 @@ files:
|
|
|
676
684
|
- lib/rubocop/cop/naming/memoized_instance_variable_name.rb
|
|
677
685
|
- lib/rubocop/cop/naming/method_name.rb
|
|
678
686
|
- lib/rubocop/cop/naming/method_parameter_name.rb
|
|
679
|
-
- lib/rubocop/cop/naming/
|
|
687
|
+
- lib/rubocop/cop/naming/predicate_method.rb
|
|
688
|
+
- lib/rubocop/cop/naming/predicate_prefix.rb
|
|
680
689
|
- lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb
|
|
681
690
|
- lib/rubocop/cop/naming/variable_name.rb
|
|
682
691
|
- lib/rubocop/cop/naming/variable_number.rb
|
|
@@ -699,6 +708,7 @@ files:
|
|
|
699
708
|
- lib/rubocop/cop/style/array_coercion.rb
|
|
700
709
|
- lib/rubocop/cop/style/array_first_last.rb
|
|
701
710
|
- lib/rubocop/cop/style/array_intersect.rb
|
|
711
|
+
- lib/rubocop/cop/style/array_intersect_with_single_element.rb
|
|
702
712
|
- lib/rubocop/cop/style/array_join.rb
|
|
703
713
|
- lib/rubocop/cop/style/ascii_comments.rb
|
|
704
714
|
- lib/rubocop/cop/style/attr.rb
|
|
@@ -721,6 +731,7 @@ files:
|
|
|
721
731
|
- lib/rubocop/cop/style/class_vars.rb
|
|
722
732
|
- lib/rubocop/cop/style/collection_compact.rb
|
|
723
733
|
- lib/rubocop/cop/style/collection_methods.rb
|
|
734
|
+
- lib/rubocop/cop/style/collection_querying.rb
|
|
724
735
|
- lib/rubocop/cop/style/colon_method_call.rb
|
|
725
736
|
- lib/rubocop/cop/style/colon_method_definition.rb
|
|
726
737
|
- lib/rubocop/cop/style/combinable_defined.rb
|
|
@@ -728,6 +739,7 @@ files:
|
|
|
728
739
|
- lib/rubocop/cop/style/command_literal.rb
|
|
729
740
|
- lib/rubocop/cop/style/comment_annotation.rb
|
|
730
741
|
- lib/rubocop/cop/style/commented_keyword.rb
|
|
742
|
+
- lib/rubocop/cop/style/comparable_between.rb
|
|
731
743
|
- lib/rubocop/cop/style/comparable_clamp.rb
|
|
732
744
|
- lib/rubocop/cop/style/concat_array_literals.rb
|
|
733
745
|
- lib/rubocop/cop/style/conditional_assignment.rb
|
|
@@ -754,6 +766,7 @@ files:
|
|
|
754
766
|
- lib/rubocop/cop/style/empty_lambda_parameter.rb
|
|
755
767
|
- lib/rubocop/cop/style/empty_literal.rb
|
|
756
768
|
- lib/rubocop/cop/style/empty_method.rb
|
|
769
|
+
- lib/rubocop/cop/style/empty_string_inside_interpolation.rb
|
|
757
770
|
- lib/rubocop/cop/style/encoding.rb
|
|
758
771
|
- lib/rubocop/cop/style/end_block.rb
|
|
759
772
|
- lib/rubocop/cop/style/endless_method.rb
|
|
@@ -782,6 +795,7 @@ files:
|
|
|
782
795
|
- lib/rubocop/cop/style/hash_conversion.rb
|
|
783
796
|
- lib/rubocop/cop/style/hash_each_methods.rb
|
|
784
797
|
- lib/rubocop/cop/style/hash_except.rb
|
|
798
|
+
- lib/rubocop/cop/style/hash_fetch_chain.rb
|
|
785
799
|
- lib/rubocop/cop/style/hash_like_case.rb
|
|
786
800
|
- lib/rubocop/cop/style/hash_slice.rb
|
|
787
801
|
- lib/rubocop/cop/style/hash_syntax.rb
|
|
@@ -801,6 +815,7 @@ files:
|
|
|
801
815
|
- lib/rubocop/cop/style/invertible_unless_condition.rb
|
|
802
816
|
- lib/rubocop/cop/style/ip_addresses.rb
|
|
803
817
|
- lib/rubocop/cop/style/it_assignment.rb
|
|
818
|
+
- lib/rubocop/cop/style/it_block_parameter.rb
|
|
804
819
|
- lib/rubocop/cop/style/keyword_arguments_merging.rb
|
|
805
820
|
- lib/rubocop/cop/style/keyword_parameters_order.rb
|
|
806
821
|
- lib/rubocop/cop/style/lambda.rb
|
|
@@ -872,6 +887,7 @@ files:
|
|
|
872
887
|
- lib/rubocop/cop/style/random_with_offset.rb
|
|
873
888
|
- lib/rubocop/cop/style/redundant_argument.rb
|
|
874
889
|
- lib/rubocop/cop/style/redundant_array_constructor.rb
|
|
890
|
+
- lib/rubocop/cop/style/redundant_array_flatten.rb
|
|
875
891
|
- lib/rubocop/cop/style/redundant_assignment.rb
|
|
876
892
|
- lib/rubocop/cop/style/redundant_begin.rb
|
|
877
893
|
- lib/rubocop/cop/style/redundant_capital_w.rb
|
|
@@ -971,7 +987,6 @@ files:
|
|
|
971
987
|
- lib/rubocop/cop/team.rb
|
|
972
988
|
- lib/rubocop/cop/util.rb
|
|
973
989
|
- lib/rubocop/cop/utils/format_string.rb
|
|
974
|
-
- lib/rubocop/cop/utils/regexp_ranges.rb
|
|
975
990
|
- lib/rubocop/cop/variable_force.rb
|
|
976
991
|
- lib/rubocop/cop/variable_force/assignment.rb
|
|
977
992
|
- lib/rubocop/cop/variable_force/branch.rb
|
|
@@ -1028,6 +1043,7 @@ files:
|
|
|
1028
1043
|
- lib/rubocop/name_similarity.rb
|
|
1029
1044
|
- lib/rubocop/options.rb
|
|
1030
1045
|
- lib/rubocop/path_util.rb
|
|
1046
|
+
- lib/rubocop/pending_cops_reporter.rb
|
|
1031
1047
|
- lib/rubocop/platform.rb
|
|
1032
1048
|
- lib/rubocop/plugin.rb
|
|
1033
1049
|
- lib/rubocop/plugin/configuration_integrator.rb
|
|
@@ -1075,9 +1091,9 @@ licenses:
|
|
|
1075
1091
|
- MIT
|
|
1076
1092
|
metadata:
|
|
1077
1093
|
homepage_uri: https://rubocop.org/
|
|
1078
|
-
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.
|
|
1094
|
+
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.81.7
|
|
1079
1095
|
source_code_uri: https://github.com/rubocop/rubocop/
|
|
1080
|
-
documentation_uri: https://docs.rubocop.org/rubocop/1.
|
|
1096
|
+
documentation_uri: https://docs.rubocop.org/rubocop/1.81/
|
|
1081
1097
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
|
1082
1098
|
rubygems_mfa_required: 'true'
|
|
1083
1099
|
rdoc_options: []
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module RuboCop
|
|
4
|
-
module Cop
|
|
5
|
-
module Utils
|
|
6
|
-
# Helper to abstract complexity of building range pairs
|
|
7
|
-
# with octal escape reconstruction (needed for regexp_parser < 2.7).
|
|
8
|
-
class RegexpRanges
|
|
9
|
-
attr_reader :root
|
|
10
|
-
|
|
11
|
-
def initialize(root)
|
|
12
|
-
@root = root
|
|
13
|
-
@compound_token = []
|
|
14
|
-
@pairs = []
|
|
15
|
-
@populated = false
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def compound_token
|
|
19
|
-
populate_all unless @populated
|
|
20
|
-
|
|
21
|
-
@compound_token
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def pairs
|
|
25
|
-
populate_all unless @populated
|
|
26
|
-
|
|
27
|
-
@pairs
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
def populate_all
|
|
33
|
-
populate(@root)
|
|
34
|
-
|
|
35
|
-
# If either bound is a compound the first one is an escape
|
|
36
|
-
# and that's all we need to work with.
|
|
37
|
-
# If there are any cops that wanted to operate on the compound
|
|
38
|
-
# expression we could wrap it with a facade class.
|
|
39
|
-
@pairs.map! { |pair| pair.map(&:first) }
|
|
40
|
-
|
|
41
|
-
@populated = true
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def populate(expr)
|
|
45
|
-
expressions = expr.expressions.to_a
|
|
46
|
-
|
|
47
|
-
until expressions.empty?
|
|
48
|
-
current = expressions.shift
|
|
49
|
-
|
|
50
|
-
if escaped_octal?(current)
|
|
51
|
-
@compound_token << current
|
|
52
|
-
@compound_token.concat(pop_octal_digits(expressions))
|
|
53
|
-
# If we have all the digits we can discard.
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
next unless current.type == :set
|
|
57
|
-
|
|
58
|
-
process_set(expressions, current)
|
|
59
|
-
@compound_token.clear
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def process_set(expressions, current)
|
|
64
|
-
case current.token
|
|
65
|
-
when :range
|
|
66
|
-
@pairs << compose_range(expressions, current)
|
|
67
|
-
when :character
|
|
68
|
-
# Child expressions may include the range we are looking for.
|
|
69
|
-
populate(current)
|
|
70
|
-
when :intersection
|
|
71
|
-
# Each child expression could have child expressions that lead to ranges.
|
|
72
|
-
current.expressions.each do |intersected|
|
|
73
|
-
populate(intersected)
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def compose_range(expressions, current)
|
|
79
|
-
range_start, range_end = current.expressions
|
|
80
|
-
range_start = if @compound_token.size.between?(1, 2) && octal_digit?(range_start.text)
|
|
81
|
-
@compound_token.dup << range_start
|
|
82
|
-
else
|
|
83
|
-
[range_start]
|
|
84
|
-
end
|
|
85
|
-
range_end = [range_end]
|
|
86
|
-
range_end.concat(pop_octal_digits(expressions)) if escaped_octal?(range_end.first)
|
|
87
|
-
[range_start, range_end]
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def escaped_octal?(expr)
|
|
91
|
-
expr.text.valid_encoding? && expr.text =~ /^\\[0-7]$/
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def octal_digit?(char)
|
|
95
|
-
('0'..'7').cover?(char)
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def pop_octal_digits(expressions)
|
|
99
|
-
digits = []
|
|
100
|
-
|
|
101
|
-
2.times do
|
|
102
|
-
next unless (next_child = expressions.first)
|
|
103
|
-
next unless next_child.type == :literal && next_child.text =~ /^[0-7]$/
|
|
104
|
-
|
|
105
|
-
digits << expressions.shift
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
digits
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
end
|