rubocop 1.7.0 → 1.10.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 -3
- data/config/default.yml +137 -31
- data/config/obsoletion.yml +4 -0
- data/lib/rubocop.rb +14 -1
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +5 -4
- data/lib/rubocop/comment_config.rb +6 -6
- data/lib/rubocop/config.rb +5 -2
- data/lib/rubocop/config_loader.rb +7 -14
- data/lib/rubocop/config_store.rb +12 -1
- data/lib/rubocop/cop/base.rb +2 -1
- data/lib/rubocop/cop/exclude_limit.rb +26 -0
- data/lib/rubocop/cop/gemspec/date_assignment.rb +56 -0
- data/lib/rubocop/cop/generator.rb +1 -3
- data/lib/rubocop/cop/internal_affairs.rb +5 -1
- data/lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb +68 -0
- data/lib/rubocop/cop/internal_affairs/example_description.rb +89 -0
- data/lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb +61 -0
- data/lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb +64 -0
- data/lib/rubocop/cop/layout/class_structure.rb +7 -2
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +38 -18
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +16 -2
- data/lib/rubocop/cop/layout/line_length.rb +2 -1
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +26 -0
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/space_before_brackets.rb +19 -16
- data/lib/rubocop/cop/lint/debugger.rb +58 -14
- data/lib/rubocop/cop/lint/deprecated_constants.rb +80 -0
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +13 -4
- data/lib/rubocop/cop/lint/duplicate_require.rb +2 -2
- data/lib/rubocop/cop/lint/else_layout.rb +1 -1
- data/lib/rubocop/cop/lint/lambda_without_literal_block.rb +44 -0
- data/lib/rubocop/cop/lint/multiple_comparison.rb +4 -4
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +10 -6
- data/lib/rubocop/cop/lint/number_conversion.rb +41 -6
- data/lib/rubocop/cop/lint/numbered_parameter_assignment.rb +47 -0
- data/lib/rubocop/cop/lint/or_assignment_to_constant.rb +39 -0
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +2 -1
- data/lib/rubocop/cop/lint/redundant_dir_glob_sort.rb +50 -0
- data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +5 -3
- data/lib/rubocop/cop/lint/symbol_conversion.rb +103 -0
- data/lib/rubocop/cop/lint/triple_quotes.rb +71 -0
- data/lib/rubocop/cop/message_annotator.rb +4 -1
- data/lib/rubocop/cop/metrics/block_nesting.rb +2 -2
- data/lib/rubocop/cop/metrics/parameter_lists.rb +5 -2
- data/lib/rubocop/cop/mixin/allowed_identifiers.rb +18 -0
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +5 -0
- data/lib/rubocop/cop/mixin/code_length.rb +3 -1
- data/lib/rubocop/cop/mixin/comments_help.rb +1 -11
- data/lib/rubocop/cop/mixin/configurable_max.rb +1 -0
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +1 -1
- data/lib/rubocop/cop/mixin/method_complexity.rb +3 -1
- data/lib/rubocop/cop/mixin/preferred_delimiters.rb +2 -2
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +5 -1
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +38 -5
- data/lib/rubocop/cop/naming/variable_name.rb +2 -0
- data/lib/rubocop/cop/naming/variable_number.rb +2 -9
- data/lib/rubocop/cop/registry.rb +1 -1
- data/lib/rubocop/cop/severity.rb +3 -3
- data/lib/rubocop/cop/style/ascii_comments.rb +1 -1
- data/lib/rubocop/cop/style/constant_visibility.rb +27 -0
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +49 -9
- data/lib/rubocop/cop/style/double_negation.rb +2 -2
- data/lib/rubocop/cop/style/empty_literal.rb +6 -2
- data/lib/rubocop/cop/style/endless_method.rb +102 -0
- data/lib/rubocop/cop/style/eval_with_location.rb +138 -49
- data/lib/rubocop/cop/style/explicit_block_argument.rb +11 -1
- data/lib/rubocop/cop/style/exponential_notation.rb +6 -7
- data/lib/rubocop/cop/style/float_division.rb +3 -0
- data/lib/rubocop/cop/style/format_string_token.rb +18 -2
- data/lib/rubocop/cop/style/hash_conversion.rb +81 -0
- data/lib/rubocop/cop/style/hash_like_case.rb +2 -1
- data/lib/rubocop/cop/style/if_inside_else.rb +22 -10
- data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +120 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +4 -0
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +4 -0
- data/lib/rubocop/cop/style/nil_comparison.rb +3 -0
- data/lib/rubocop/cop/style/non_nil_check.rb +23 -13
- data/lib/rubocop/cop/style/numeric_literals.rb +6 -9
- data/lib/rubocop/cop/style/numeric_predicate.rb +1 -1
- data/lib/rubocop/cop/style/raise_args.rb +3 -2
- data/lib/rubocop/cop/style/redundant_return.rb +1 -1
- data/lib/rubocop/cop/style/single_line_methods.rb +32 -2
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +29 -5
- data/lib/rubocop/cop/style/special_global_vars.rb +3 -3
- data/lib/rubocop/cop/style/string_concatenation.rb +1 -1
- data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/while_until_modifier.rb +2 -4
- data/lib/rubocop/formatter/git_hub_actions_formatter.rb +1 -0
- data/lib/rubocop/formatter/offense_count_formatter.rb +1 -1
- data/lib/rubocop/formatter/simple_text_formatter.rb +2 -1
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +1 -1
- data/lib/rubocop/magic_comment.rb +30 -1
- data/lib/rubocop/options.rb +1 -1
- data/lib/rubocop/rspec/expect_offense.rb +5 -2
- data/lib/rubocop/runner.rb +1 -0
- data/lib/rubocop/target_ruby.rb +47 -11
- data/lib/rubocop/version.rb +2 -2
- metadata +24 -7
    
        data/lib/rubocop/version.rb
    CHANGED
    
    | @@ -3,7 +3,7 @@ | |
| 3 3 | 
             
            module RuboCop
         | 
| 4 4 | 
             
              # This module holds the RuboCop version information.
         | 
| 5 5 | 
             
              module Version
         | 
| 6 | 
            -
                STRING = '1. | 
| 6 | 
            +
                STRING = '1.10.0'
         | 
| 7 7 |  | 
| 8 8 | 
             
                MSG = '%<version>s (using Parser %<parser_version>s, '\
         | 
| 9 9 | 
             
                      'rubocop-ast %<rubocop_ast_version>s, ' \
         | 
| @@ -37,7 +37,7 @@ module RuboCop | |
| 37 37 | 
             
                  features = Util.silence_warnings do
         | 
| 38 38 | 
             
                    # Suppress any config issues when loading the config (ie. deprecations,
         | 
| 39 39 | 
             
                    # pending cops, etc.).
         | 
| 40 | 
            -
                    env.config_store.for_pwd.loaded_features.sort
         | 
| 40 | 
            +
                    env.config_store.unvalidated.for_pwd.loaded_features.sort
         | 
| 41 41 | 
             
                  end
         | 
| 42 42 |  | 
| 43 43 | 
             
                  features.map do |loaded_feature|
         | 
    
        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.10.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Bozhidar Batsov
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: exe
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date:  | 
| 13 | 
            +
            date: 2021-02-15 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: parallel
         | 
| @@ -32,14 +32,14 @@ dependencies: | |
| 32 32 | 
             
                requirements:
         | 
| 33 33 | 
             
                - - ">="
         | 
| 34 34 | 
             
                  - !ruby/object:Gem::Version
         | 
| 35 | 
            -
                    version:  | 
| 35 | 
            +
                    version: 3.0.0.0
         | 
| 36 36 | 
             
              type: :runtime
         | 
| 37 37 | 
             
              prerelease: false
         | 
| 38 38 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 39 39 | 
             
                requirements:
         | 
| 40 40 | 
             
                - - ">="
         | 
| 41 41 | 
             
                  - !ruby/object:Gem::Version
         | 
| 42 | 
            -
                    version:  | 
| 42 | 
            +
                    version: 3.0.0.0
         | 
| 43 43 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 44 44 | 
             
              name: rainbow
         | 
| 45 45 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -137,7 +137,7 @@ dependencies: | |
| 137 137 | 
             
                    version: 1.4.0
         | 
| 138 138 | 
             
                - - "<"
         | 
| 139 139 | 
             
                  - !ruby/object:Gem::Version
         | 
| 140 | 
            -
                    version: ' | 
| 140 | 
            +
                    version: '3.0'
         | 
| 141 141 | 
             
              type: :runtime
         | 
| 142 142 | 
             
              prerelease: false
         | 
| 143 143 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| @@ -147,7 +147,7 @@ dependencies: | |
| 147 147 | 
             
                    version: 1.4.0
         | 
| 148 148 | 
             
                - - "<"
         | 
| 149 149 | 
             
                  - !ruby/object:Gem::Version
         | 
| 150 | 
            -
                    version: ' | 
| 150 | 
            +
                    version: '3.0'
         | 
| 151 151 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 152 152 | 
             
              name: bundler
         | 
| 153 153 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -242,7 +242,9 @@ files: | |
| 242 242 | 
             
            - lib/rubocop/cop/correctors/string_literal_corrector.rb
         | 
| 243 243 | 
             
            - lib/rubocop/cop/correctors/unused_arg_corrector.rb
         | 
| 244 244 | 
             
            - lib/rubocop/cop/documentation.rb
         | 
| 245 | 
            +
            - lib/rubocop/cop/exclude_limit.rb
         | 
| 245 246 | 
             
            - lib/rubocop/cop/force.rb
         | 
| 247 | 
            +
            - lib/rubocop/cop/gemspec/date_assignment.rb
         | 
| 246 248 | 
             
            - lib/rubocop/cop/gemspec/duplicated_assignment.rb
         | 
| 247 249 | 
             
            - lib/rubocop/cop/gemspec/ordered_dependencies.rb
         | 
| 248 250 | 
             
            - lib/rubocop/cop/gemspec/required_ruby_version.rb
         | 
| @@ -252,10 +254,14 @@ files: | |
| 252 254 | 
             
            - lib/rubocop/cop/generator/require_file_injector.rb
         | 
| 253 255 | 
             
            - lib/rubocop/cop/ignored_node.rb
         | 
| 254 256 | 
             
            - lib/rubocop/cop/internal_affairs.rb
         | 
| 257 | 
            +
            - lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb
         | 
| 258 | 
            +
            - lib/rubocop/cop/internal_affairs/example_description.rb
         | 
| 255 259 | 
             
            - lib/rubocop/cop/internal_affairs/method_name_equal.rb
         | 
| 256 260 | 
             
            - lib/rubocop/cop/internal_affairs/node_destructuring.rb
         | 
| 257 261 | 
             
            - lib/rubocop/cop/internal_affairs/node_type_predicate.rb
         | 
| 258 262 | 
             
            - lib/rubocop/cop/internal_affairs/offense_location_keyword.rb
         | 
| 263 | 
            +
            - lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb
         | 
| 264 | 
            +
            - lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb
         | 
| 259 265 | 
             
            - lib/rubocop/cop/internal_affairs/redundant_location_argument.rb
         | 
| 260 266 | 
             
            - lib/rubocop/cop/internal_affairs/redundant_message_argument.rb
         | 
| 261 267 | 
             
            - lib/rubocop/cop/internal_affairs/style_detected_api_use.rb
         | 
| @@ -368,6 +374,7 @@ files: | |
| 368 374 | 
             
            - lib/rubocop/cop/lint/constant_resolution.rb
         | 
| 369 375 | 
             
            - lib/rubocop/cop/lint/debugger.rb
         | 
| 370 376 | 
             
            - lib/rubocop/cop/lint/deprecated_class_methods.rb
         | 
| 377 | 
            +
            - lib/rubocop/cop/lint/deprecated_constants.rb
         | 
| 371 378 | 
             
            - lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb
         | 
| 372 379 | 
             
            - lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
         | 
| 373 380 | 
             
            - lib/rubocop/cop/lint/duplicate_branch.rb
         | 
| @@ -401,6 +408,7 @@ files: | |
| 401 408 | 
             
            - lib/rubocop/cop/lint/ineffective_access_modifier.rb
         | 
| 402 409 | 
             
            - lib/rubocop/cop/lint/inherit_exception.rb
         | 
| 403 410 | 
             
            - lib/rubocop/cop/lint/interpolation_check.rb
         | 
| 411 | 
            +
            - lib/rubocop/cop/lint/lambda_without_literal_block.rb
         | 
| 404 412 | 
             
            - lib/rubocop/cop/lint/literal_as_condition.rb
         | 
| 405 413 | 
             
            - lib/rubocop/cop/lint/literal_in_interpolation.rb
         | 
| 406 414 | 
             
            - lib/rubocop/cop/lint/loop.rb
         | 
| @@ -415,6 +423,8 @@ files: | |
| 415 423 | 
             
            - lib/rubocop/cop/lint/non_deterministic_require_order.rb
         | 
| 416 424 | 
             
            - lib/rubocop/cop/lint/non_local_exit_from_iterator.rb
         | 
| 417 425 | 
             
            - lib/rubocop/cop/lint/number_conversion.rb
         | 
| 426 | 
            +
            - lib/rubocop/cop/lint/numbered_parameter_assignment.rb
         | 
| 427 | 
            +
            - lib/rubocop/cop/lint/or_assignment_to_constant.rb
         | 
| 418 428 | 
             
            - lib/rubocop/cop/lint/ordered_magic_comments.rb
         | 
| 419 429 | 
             
            - lib/rubocop/cop/lint/out_of_range_regexp_ref.rb
         | 
| 420 430 | 
             
            - lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
         | 
| @@ -424,6 +434,7 @@ files: | |
| 424 434 | 
             
            - lib/rubocop/cop/lint/rand_one.rb
         | 
| 425 435 | 
             
            - lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
         | 
| 426 436 | 
             
            - lib/rubocop/cop/lint/redundant_cop_enable_directive.rb
         | 
| 437 | 
            +
            - lib/rubocop/cop/lint/redundant_dir_glob_sort.rb
         | 
| 427 438 | 
             
            - lib/rubocop/cop/lint/redundant_require_statement.rb
         | 
| 428 439 | 
             
            - lib/rubocop/cop/lint/redundant_safe_navigation.rb
         | 
| 429 440 | 
             
            - lib/rubocop/cop/lint/redundant_splat_expansion.rb
         | 
| @@ -446,11 +457,13 @@ files: | |
| 446 457 | 
             
            - lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
         | 
| 447 458 | 
             
            - lib/rubocop/cop/lint/struct_new_override.rb
         | 
| 448 459 | 
             
            - lib/rubocop/cop/lint/suppressed_exception.rb
         | 
| 460 | 
            +
            - lib/rubocop/cop/lint/symbol_conversion.rb
         | 
| 449 461 | 
             
            - lib/rubocop/cop/lint/syntax.rb
         | 
| 450 462 | 
             
            - lib/rubocop/cop/lint/to_enum_arguments.rb
         | 
| 451 463 | 
             
            - lib/rubocop/cop/lint/to_json.rb
         | 
| 452 464 | 
             
            - lib/rubocop/cop/lint/top_level_return_with_argument.rb
         | 
| 453 465 | 
             
            - lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb
         | 
| 466 | 
            +
            - lib/rubocop/cop/lint/triple_quotes.rb
         | 
| 454 467 | 
             
            - lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
         | 
| 455 468 | 
             
            - lib/rubocop/cop/lint/unexpected_block_arity.rb
         | 
| 456 469 | 
             
            - lib/rubocop/cop/lint/unified_integer.rb
         | 
| @@ -485,6 +498,7 @@ files: | |
| 485 498 | 
             
            - lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb
         | 
| 486 499 | 
             
            - lib/rubocop/cop/migration/department_name.rb
         | 
| 487 500 | 
             
            - lib/rubocop/cop/mixin/alignment.rb
         | 
| 501 | 
            +
            - lib/rubocop/cop/mixin/allowed_identifiers.rb
         | 
| 488 502 | 
             
            - lib/rubocop/cop/mixin/allowed_methods.rb
         | 
| 489 503 | 
             
            - lib/rubocop/cop/mixin/annotation_comment.rb
         | 
| 490 504 | 
             
            - lib/rubocop/cop/mixin/array_min_size.rb
         | 
| @@ -627,6 +641,7 @@ files: | |
| 627 641 | 
             
            - lib/rubocop/cop/style/empty_method.rb
         | 
| 628 642 | 
             
            - lib/rubocop/cop/style/encoding.rb
         | 
| 629 643 | 
             
            - lib/rubocop/cop/style/end_block.rb
         | 
| 644 | 
            +
            - lib/rubocop/cop/style/endless_method.rb
         | 
| 630 645 | 
             
            - lib/rubocop/cop/style/eval_with_location.rb
         | 
| 631 646 | 
             
            - lib/rubocop/cop/style/even_odd.rb
         | 
| 632 647 | 
             
            - lib/rubocop/cop/style/expand_path_arguments.rb
         | 
| @@ -641,6 +656,7 @@ files: | |
| 641 656 | 
             
            - lib/rubocop/cop/style/global_vars.rb
         | 
| 642 657 | 
             
            - lib/rubocop/cop/style/guard_clause.rb
         | 
| 643 658 | 
             
            - lib/rubocop/cop/style/hash_as_last_array_item.rb
         | 
| 659 | 
            +
            - lib/rubocop/cop/style/hash_conversion.rb
         | 
| 644 660 | 
             
            - lib/rubocop/cop/style/hash_each_methods.rb
         | 
| 645 661 | 
             
            - lib/rubocop/cop/style/hash_except.rb
         | 
| 646 662 | 
             
            - lib/rubocop/cop/style/hash_like_case.rb
         | 
| @@ -651,6 +667,7 @@ files: | |
| 651 667 | 
             
            - lib/rubocop/cop/style/if_inside_else.rb
         | 
| 652 668 | 
             
            - lib/rubocop/cop/style/if_unless_modifier.rb
         | 
| 653 669 | 
             
            - lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb
         | 
| 670 | 
            +
            - lib/rubocop/cop/style/if_with_boolean_literal_branches.rb
         | 
| 654 671 | 
             
            - lib/rubocop/cop/style/if_with_semicolon.rb
         | 
| 655 672 | 
             
            - lib/rubocop/cop/style/implicit_runtime_error.rb
         | 
| 656 673 | 
             
            - lib/rubocop/cop/style/infinite_loop.rb
         | 
| @@ -851,7 +868,7 @@ metadata: | |
| 851 868 | 
             
              homepage_uri: https://rubocop.org/
         | 
| 852 869 | 
             
              changelog_uri: https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md
         | 
| 853 870 | 
             
              source_code_uri: https://github.com/rubocop-hq/rubocop/
         | 
| 854 | 
            -
              documentation_uri: https://docs.rubocop.org/rubocop/1. | 
| 871 | 
            +
              documentation_uri: https://docs.rubocop.org/rubocop/1.10/
         | 
| 855 872 | 
             
              bug_tracker_uri: https://github.com/rubocop-hq/rubocop/issues
         | 
| 856 873 | 
             
            post_install_message: 
         | 
| 857 874 | 
             
            rdoc_options: []
         |